本文整理了Java中nablarch.core.log.Logger
类的一些代码示例,展示了Logger
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger
类的具体详情如下:
包路径:nablarch.core.log.Logger
类名称:Logger
[英]ログを出力するインタフェース。
ログ出力機能の実装毎に本インタフェースの実装クラスを作成する。
アプリケーションから障害ログ出力を行う必要がある場合は、本インタフェースを直接使用するのではなく、 nablarch.core.log.app.FailureLogUtilを使用すること。 また、TRACEレベルのログ出力については、アプリケーション開発での使用は想定していない為、 非公開としている。
[中]ログを出力するインタフェース。
ログ出力機能の実装毎に本インタフェースの実装クラスを作成する。
アプリケーションから障害ログ出力を行う必要がある場合は、本インタフェースを直接使用するのではなく、 纳布拉奇。果心日志应用程序。故障日志工具を使用すること。 また、查出レベルのログ出力については、アプリケーション開発での使用は想定していない為、 非公開としている。
代码示例来源:origin: com.nablarch.framework/nablarch-core-applog
/**
* {@inheritDoc}
* 総コミット件数をログ出力する。
* 初期化が行われていない場合は、何も行わない。
*/
public synchronized void terminate() {
if (!initialized) {
return;
}
initialized = false;
totalCommitCount += commitCount;
LOGGER.logInfo("TOTAL COMMIT COUNT = [" + totalCommitCount + ']');
}
代码示例来源:origin: com.nablarch.framework/nablarch-core
/**
* メッセージをログに出力する。
*
* @param level ログレベル
* @param message メッセージ
*/
public static void write(final LogLevel level, final String message) {
switch (level) {
case FATAL:
LOGGER.logFatal(message);
break;
case ERROR:
LOGGER.logError(message);
break;
case WARN:
LOGGER.logWarn(message);
break;
case INFO:
LOGGER.logInfo(message);
break;
case DEBUG:
LOGGER.logDebug(message);
break;
case TRACE:
LOGGER.logTrace(message);
break;
}
}
代码示例来源:origin: com.nablarch.framework/nablarch-fw-web-extension
/** アップロードファイルの中身をログ出力する。 */
private void logContentOfUploaded() {
if (LOGGER.isDebugEnabled()) {
LOGGER.logDebug(concat(
"content of uploaded file is [",
BinaryUtil.convertToHexStringWithPrefix(toByteArray()),
"]"));
}
}
代码示例来源:origin: com.nablarch.framework/nablarch-fw-web-tag
/**
* 開閉局ステータスチェック中に発生したエラーを処理する。
*
* 捕捉した例外をINFOレベルのログに出力し、falseをリターンする。
*
* @param e 起因例外
* @return 必ずfalseを返却する。
* (ボタン・リンクの表示制御は行われず、通常と同様の表示となる。)
*/
private boolean handleError(Throwable e) {
if (LOGGER.isInfoEnabled()) {
LOGGER.logInfo(
"Failed to pre-check the availability of business services. "
+ "It is needed for determining appearance of some buttons and links. "
+ "(They are showed in ordinal appearance.)"
, e
);
}
return false;
}
代码示例来源:origin: com.nablarch.framework/nablarch-common-jdbc
/**
* ワーニングログの出力を行う。
* <br/>
*
* @param throwable ログに出力する例外
*/
private static void writeWarnLog(Throwable throwable) {
if (throwable != null) {
LOGGER.logWarn("DbConnectionManagementHandler#handle failed in the application process.", throwable);
}
}
代码示例来源:origin: com.nablarch.framework/nablarch-fw-standalone
if (LOGGER.isTraceEnabled()) {
LOGGER.logTrace(
"request thread waits "
+ interval + "msec "
LOGGER.logInfo("the shutdown flag of this process was set. shutting down...");
return new Result.Success("shut down this process normally.");
LOGGER.logInfo("Uncaught error: ", e);
throw e;
LOGGER.logDebug("couldn't write log. : ", e);
代码示例来源:origin: com.nablarch.framework/nablarch-fw-standalone
LOGGER.logInfo(String.format("DATA WATCH INTERVAL = [%dms]",
dataWatchInterval));
} catch (ServiceUnavailable e) {
if (LOGGER.isTraceEnabled()) {
LOGGER.logTrace(
"this process is asleep because the service "
+ "temporarily unavailable.");
} else if (isProcessNormalEnd(e)) {
LOGGER.logInfo("stop the resident process.", e);
break;
代码示例来源:origin: com.nablarch.framework/nablarch-fw
LOGGER.logInfo("Uncaught error: ", e);
throw e;
LOGGER.logDebug("couldn't write log. : ", e);
代码示例来源:origin: com.nablarch.framework/nablarch-fw-web-tag
if (LOGGER.isWarnEnabled()) {
LOGGER.logWarn(
"A requestPath that requires the hidden tag encryption "
+ "can not belongs to a <form> tag that contains another path "
代码示例来源:origin: com.nablarch.framework/nablarch-fw-standalone
/**
* {@inheritDoc}
* <p/>
* 現在のリトライ経過時間が最長リトライ時間を超えている場合は、
* {@link #reset()}メソッドを呼び出し、リトライ状態をリセットする。
* <p/>
* 判定処理は{@link #onIsRetryable()}メソッドに委譲する。
*/
public boolean isRetryable() {
if (startTime != null) {
long elapsedTime = System.currentTimeMillis() - startTime;
if (LOGGER.isTraceEnabled()) {
LOGGER.logTrace(
String.format("startTime = [%s], maxRetryTime = [%s], elapsedTime = [%s]",
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date(startTime)),
maxRetryTime, elapsedTime));
}
if (maxRetryTime < elapsedTime) {
reset();
}
}
return onIsRetryable();
}
代码示例来源:origin: com.nablarch.framework/nablarch-core-beans
LOGGER.logDebug(
"An error occurred while writing to the property :" + entry.getKey());
代码示例来源:origin: com.nablarch.framework/nablarch-fw-messaging
/**
* メッセージを送信する。
*
* @param message 送信メッセージ
* @return 送信メッセージのメッセージID
*/
public String send(SendingMessage message) {
String messageId = sendMessage(message);
if (LOGGER.isInfoEnabled()) {
emitLog(message);
}
return messageId;
}
代码示例来源:origin: com.nablarch.framework/nablarch-core-applog
/**
* 測定を開始する。
* @param point 測定対象を識別するID
*/
@Published(tag = "architect")
public static void start(String point) {
if (!PERFORMANCE_LOGGER.isDebugEnabled()) {
return;
}
PerformanceLogFormatter formatter = getPerformanceLogFormatter();
if (!formatter.isTargetPoint(point)) {
return;
}
formatter.start(point);
}
代码示例来源:origin: com.nablarch.framework/nablarch-core-transaction
/**
* ワーニングレベルのログを出力する。
*
* @param throwable ログに出力する例外
*/
private static void writeWarnLog(Throwable throwable) {
LOGGER.logWarn("transaction has failed.", throwable);
}
}
代码示例来源:origin: com.nablarch.framework/nablarch-fw-messaging-http
LOGGER.logInfo(Builder.concat("There were no Handlers in handlerQueue.",
" uri = [", req.getRequestUri(), "]"));
return HttpResponse.Status.NOT_FOUND.handle(req, ctx);
|| e instanceof ApplicationException) {
if (LOGGER.isTraceEnabled()) {
LOGGER.logTrace("Error due to an invalid request message: ", e);
代码示例来源:origin: com.nablarch.framework/nablarch-fw-messaging
ReceivedMessage reply = receiveSync(replyQueueName, messageId, timeout);
if (reply == null) {
if (LOGGER.isInfoEnabled()) {
LOGGER.logInfo(
"response timeout: could not receive a reply to the message below."
+ MessagingLogUtil.getSentMessageLog(message));
代码示例来源:origin: com.nablarch.framework/nablarch-common-auth
@Override
public Result handleInbound(ExecutionContext context) {
String requestId = usesInternalRequestId
? ThreadContext.getInternalRequestId()
: ThreadContext.getRequestId();
if (!serviceAvailability.isAvailable(requestId)) {
if (LOGGER.isTraceEnabled()) {
LOGGER.logTrace(Builder.concat(
"service unavailable. requestId=[", requestId, "]"));
}
throw new ServiceUnavailable();
}
return new Result.Success();
}
}
代码示例来源:origin: com.nablarch.framework/nablarch-core-beans
final PropertyDescriptor destPd = destPds.get(propertyName);
if (destPd == null) {
LOGGER.logDebug("An error occurred while copying the property :" + propertyName);
continue;
LOGGER.logDebug("An error occurred while copying the property :" + propertyName);
} catch (Exception e) {
throw new BeansException(e);
代码示例来源:origin: com.nablarch.framework/nablarch-fw-messaging
/**
* 指定した受信キュー上のメッセージを取得する。
* messageIdが指定されている場合は、当該のメッセージに対する応答電文を
* 取得する。messageIdが指定されていないばあいは、受信キュー上の任意の電文
* を取得する。
* キュー上に取得対象のメッセージが存在しない場合、メッセージを受信するか、
* 指定した時間が経過する(タイムアウトする)までブロックする。
*
* タイムアウトした場合はnullをかえす。
* タイムアウト時間に0以下の数値を設定した場合は
* 応答電文を受信するまでブロックし続ける。
*
* @param receiveQueue 受信キューの論理名
* @param messageId 送信電文のメッセージID (応答受信でない場合はnull)
* @param timeout 応答タイムアウト
* (単位:ミリ秒、0以下の数値の場合はブロックし続ける)
* @return 受信したメッセージ(タイムアウトした場合はnull)
*/
public ReceivedMessage
receiveSync(String receiveQueue, String messageId, long timeout) {
ReceivedMessage received = receiveMessage(receiveQueue, messageId, timeout);
if (received == null) {
return null;
}
if (LOGGER.isInfoEnabled()) {
emitLog(received);
}
return received;
}
代码示例来源:origin: com.nablarch.framework/nablarch-fw-web-tag
/**
* {@inheritDoc}<br>
* 例外をINFOレベルでログ出力する。
*/
public void doCatch(Throwable e) throws Throwable {
LOGGER.logInfo("exception occurred.", e);
throw e;
}
/** {@inheritDoc} */
内容来源于网络,如有侵权,请联系作者删除!