nablarch.core.log.Logger类的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(250)

本文整理了Java中nablarch.core.log.Logger类的一些代码示例,展示了Logger类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger类的具体详情如下:
包路径:nablarch.core.log.Logger
类名称:Logger

Logger介绍

[英]ログを出力するインタフェース。
ログ出力機能の実装毎に本インタフェースの実装クラスを作成する。

アプリケーションから障害ログ出力を行う必要がある場合は、本インタフェースを直接使用するのではなく、 nablarch.core.log.app.FailureLogUtilを使用すること。 また、TRACEレベルのログ出力については、アプリケーション開発での使用は想定していない為、 非公開としている。
[中]ログを出力するインタフェース。
ログ出力機能の実装毎に本インタフェースの実装クラスを作成する。
アプリケーションから障害ログ出力を行う必要がある場合は、本インタフェースを直接使用するのではなく、 纳布拉奇。果心日志应用程序。故障日志工具を使用すること。 また、查出レベルのログ出力については、アプリケーション開発での使用は想定していない為、 非公開としている。

代码示例

代码示例来源:origin: com.nablarch.framework/nablarch-core-applog

  1. /**
  2. * {@inheritDoc}
  3. * 総コミット件数をログ出力する。
  4. * 初期化が行われていない場合は、何も行わない。
  5. */
  6. public synchronized void terminate() {
  7. if (!initialized) {
  8. return;
  9. }
  10. initialized = false;
  11. totalCommitCount += commitCount;
  12. LOGGER.logInfo("TOTAL COMMIT COUNT = [" + totalCommitCount + ']');
  13. }

代码示例来源:origin: com.nablarch.framework/nablarch-core

  1. /**
  2. * メッセージをログに出力する。
  3. *
  4. * @param level ログレベル
  5. * @param message メッセージ
  6. */
  7. public static void write(final LogLevel level, final String message) {
  8. switch (level) {
  9. case FATAL:
  10. LOGGER.logFatal(message);
  11. break;
  12. case ERROR:
  13. LOGGER.logError(message);
  14. break;
  15. case WARN:
  16. LOGGER.logWarn(message);
  17. break;
  18. case INFO:
  19. LOGGER.logInfo(message);
  20. break;
  21. case DEBUG:
  22. LOGGER.logDebug(message);
  23. break;
  24. case TRACE:
  25. LOGGER.logTrace(message);
  26. break;
  27. }
  28. }

代码示例来源:origin: com.nablarch.framework/nablarch-fw-web-extension

  1. /** アップロードファイルの中身をログ出力する。 */
  2. private void logContentOfUploaded() {
  3. if (LOGGER.isDebugEnabled()) {
  4. LOGGER.logDebug(concat(
  5. "content of uploaded file is [",
  6. BinaryUtil.convertToHexStringWithPrefix(toByteArray()),
  7. "]"));
  8. }
  9. }

代码示例来源:origin: com.nablarch.framework/nablarch-fw-web-tag

  1. /**
  2. * 開閉局ステータスチェック中に発生したエラーを処理する。
  3. *
  4. * 捕捉した例外をINFOレベルのログに出力し、falseをリターンする。
  5. *
  6. * @param e 起因例外
  7. * @return 必ずfalseを返却する。
  8. * (ボタン・リンクの表示制御は行われず、通常と同様の表示となる。)
  9. */
  10. private boolean handleError(Throwable e) {
  11. if (LOGGER.isInfoEnabled()) {
  12. LOGGER.logInfo(
  13. "Failed to pre-check the availability of business services. "
  14. + "It is needed for determining appearance of some buttons and links. "
  15. + "(They are showed in ordinal appearance.)"
  16. , e
  17. );
  18. }
  19. return false;
  20. }

代码示例来源:origin: com.nablarch.framework/nablarch-common-jdbc

  1. /**
  2. * ワーニングログの出力を行う。
  3. * <br/>
  4. *
  5. * @param throwable ログに出力する例外
  6. */
  7. private static void writeWarnLog(Throwable throwable) {
  8. if (throwable != null) {
  9. LOGGER.logWarn("DbConnectionManagementHandler#handle failed in the application process.", throwable);
  10. }
  11. }

代码示例来源:origin: com.nablarch.framework/nablarch-fw-standalone

  1. if (LOGGER.isTraceEnabled()) {
  2. LOGGER.logTrace(
  3. "request thread waits "
  4. + interval + "msec "
  5. LOGGER.logInfo("the shutdown flag of this process was set. shutting down...");
  6. return new Result.Success("shut down this process normally.");
  7. LOGGER.logInfo("Uncaught error: ", e);
  8. throw e;
  9. LOGGER.logDebug("couldn't write log. : ", e);

代码示例来源:origin: com.nablarch.framework/nablarch-fw-standalone

  1. LOGGER.logInfo(String.format("DATA WATCH INTERVAL = [%dms]",
  2. dataWatchInterval));
  3. } catch (ServiceUnavailable e) {
  4. if (LOGGER.isTraceEnabled()) {
  5. LOGGER.logTrace(
  6. "this process is asleep because the service "
  7. + "temporarily unavailable.");
  8. } else if (isProcessNormalEnd(e)) {
  9. LOGGER.logInfo("stop the resident process.", e);
  10. break;

代码示例来源:origin: com.nablarch.framework/nablarch-fw

  1. LOGGER.logInfo("Uncaught error: ", e);
  2. throw e;
  3. LOGGER.logDebug("couldn't write log. : ", e);

代码示例来源:origin: com.nablarch.framework/nablarch-fw-web-tag

  1. if (LOGGER.isWarnEnabled()) {
  2. LOGGER.logWarn(
  3. "A requestPath that requires the hidden tag encryption "
  4. + "can not belongs to a <form> tag that contains another path "

代码示例来源:origin: com.nablarch.framework/nablarch-fw-standalone

  1. /**
  2. * {@inheritDoc}
  3. * <p/>
  4. * 現在のリトライ経過時間が最長リトライ時間を超えている場合は、
  5. * {@link #reset()}メソッドを呼び出し、リトライ状態をリセットする。
  6. * <p/>
  7. * 判定処理は{@link #onIsRetryable()}メソッドに委譲する。
  8. */
  9. public boolean isRetryable() {
  10. if (startTime != null) {
  11. long elapsedTime = System.currentTimeMillis() - startTime;
  12. if (LOGGER.isTraceEnabled()) {
  13. LOGGER.logTrace(
  14. String.format("startTime = [%s], maxRetryTime = [%s], elapsedTime = [%s]",
  15. new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date(startTime)),
  16. maxRetryTime, elapsedTime));
  17. }
  18. if (maxRetryTime < elapsedTime) {
  19. reset();
  20. }
  21. }
  22. return onIsRetryable();
  23. }

代码示例来源:origin: com.nablarch.framework/nablarch-core-beans

  1. LOGGER.logDebug(
  2. "An error occurred while writing to the property :" + entry.getKey());

代码示例来源:origin: com.nablarch.framework/nablarch-fw-messaging

  1. /**
  2. * メッセージを送信する。
  3. *
  4. * @param message 送信メッセージ
  5. * @return 送信メッセージのメッセージID
  6. */
  7. public String send(SendingMessage message) {
  8. String messageId = sendMessage(message);
  9. if (LOGGER.isInfoEnabled()) {
  10. emitLog(message);
  11. }
  12. return messageId;
  13. }

代码示例来源:origin: com.nablarch.framework/nablarch-core-applog

  1. /**
  2. * 測定を開始する。
  3. * @param point 測定対象を識別するID
  4. */
  5. @Published(tag = "architect")
  6. public static void start(String point) {
  7. if (!PERFORMANCE_LOGGER.isDebugEnabled()) {
  8. return;
  9. }
  10. PerformanceLogFormatter formatter = getPerformanceLogFormatter();
  11. if (!formatter.isTargetPoint(point)) {
  12. return;
  13. }
  14. formatter.start(point);
  15. }

代码示例来源:origin: com.nablarch.framework/nablarch-core-transaction

  1. /**
  2. * ワーニングレベルのログを出力する。
  3. *
  4. * @param throwable ログに出力する例外
  5. */
  6. private static void writeWarnLog(Throwable throwable) {
  7. LOGGER.logWarn("transaction has failed.", throwable);
  8. }
  9. }

代码示例来源:origin: com.nablarch.framework/nablarch-fw-messaging-http

  1. LOGGER.logInfo(Builder.concat("There were no Handlers in handlerQueue.",
  2. " uri = [", req.getRequestUri(), "]"));
  3. return HttpResponse.Status.NOT_FOUND.handle(req, ctx);
  4. || e instanceof ApplicationException) {
  5. if (LOGGER.isTraceEnabled()) {
  6. LOGGER.logTrace("Error due to an invalid request message: ", e);

代码示例来源:origin: com.nablarch.framework/nablarch-fw-messaging

  1. ReceivedMessage reply = receiveSync(replyQueueName, messageId, timeout);
  2. if (reply == null) {
  3. if (LOGGER.isInfoEnabled()) {
  4. LOGGER.logInfo(
  5. "response timeout: could not receive a reply to the message below."
  6. + MessagingLogUtil.getSentMessageLog(message));

代码示例来源:origin: com.nablarch.framework/nablarch-common-auth

  1. @Override
  2. public Result handleInbound(ExecutionContext context) {
  3. String requestId = usesInternalRequestId
  4. ? ThreadContext.getInternalRequestId()
  5. : ThreadContext.getRequestId();
  6. if (!serviceAvailability.isAvailable(requestId)) {
  7. if (LOGGER.isTraceEnabled()) {
  8. LOGGER.logTrace(Builder.concat(
  9. "service unavailable. requestId=[", requestId, "]"));
  10. }
  11. throw new ServiceUnavailable();
  12. }
  13. return new Result.Success();
  14. }
  15. }

代码示例来源:origin: com.nablarch.framework/nablarch-core-beans

  1. final PropertyDescriptor destPd = destPds.get(propertyName);
  2. if (destPd == null) {
  3. LOGGER.logDebug("An error occurred while copying the property :" + propertyName);
  4. continue;
  5. LOGGER.logDebug("An error occurred while copying the property :" + propertyName);
  6. } catch (Exception e) {
  7. throw new BeansException(e);

代码示例来源:origin: com.nablarch.framework/nablarch-fw-messaging

  1. /**
  2. * 指定した受信キュー上のメッセージを取得する。
  3. * messageIdが指定されている場合は、当該のメッセージに対する応答電文を
  4. * 取得する。messageIdが指定されていないばあいは、受信キュー上の任意の電文
  5. * を取得する。
  6. * キュー上に取得対象のメッセージが存在しない場合、メッセージを受信するか、
  7. * 指定した時間が経過する(タイムアウトする)までブロックする。
  8. *
  9. * タイムアウトした場合はnullをかえす。
  10. * タイムアウト時間に0以下の数値を設定した場合は
  11. * 応答電文を受信するまでブロックし続ける。
  12. *
  13. * @param receiveQueue 受信キューの論理名
  14. * @param messageId 送信電文のメッセージID (応答受信でない場合はnull)
  15. * @param timeout 応答タイムアウト
  16. * (単位:ミリ秒、0以下の数値の場合はブロックし続ける)
  17. * @return 受信したメッセージ(タイムアウトした場合はnull)
  18. */
  19. public ReceivedMessage
  20. receiveSync(String receiveQueue, String messageId, long timeout) {
  21. ReceivedMessage received = receiveMessage(receiveQueue, messageId, timeout);
  22. if (received == null) {
  23. return null;
  24. }
  25. if (LOGGER.isInfoEnabled()) {
  26. emitLog(received);
  27. }
  28. return received;
  29. }

代码示例来源:origin: com.nablarch.framework/nablarch-fw-web-tag

  1. /**
  2. * {@inheritDoc}<br>
  3. * 例外をINFOレベルでログ出力する。
  4. */
  5. public void doCatch(Throwable e) throws Throwable {
  6. LOGGER.logInfo("exception occurred.", e);
  7. throw e;
  8. }
  9. /** {@inheritDoc} */

相关文章