TRACE level log messages provide detailed information about the running state of an application and are usually only captured during debugging.(TRACE 級別的日誌提供了應用程序的運行狀態的詳細信息,它通常用於調試過程。)
DEBUG
500
DEBUG level log messages indicate the progress of individual requests or application activities and are usually only captured during debugging.(DEBUG 級別的日誌指示單獨請求或應用程序活動的進展,它通常在調試過程中使用。)
FINE
500
-
CONFIG
700
-
INFO
800
INFO level log messages indicate the overall progress of the application. Often used for application startup, shutdown, and other major lifecycle events.(INFO 級別的日誌指示應用程序的總體進展。它通常用於應用程序啓動、關閉和其他主要的生命週期事件。)
WARN
900
WARN level log messages indicate a situation that is not in error, but is not considered ideal. WARN log messages can indicate circumstances that could lead to errors in the future.(WARN 級別的日誌信息代表了一個不理相但也不是錯誤的狀況。WARN 日誌信息可以指示將來可能導致錯誤的情況。)
WARNING
900
-
ERROR
1000
ERROR level log messages indicate an error that has occurred that could prevent the current activity or request from completing but will not prevent the application from running.(ERROR 級別的日誌指示可能阻止當前活動完成但不會阻止應用程序運行的錯誤已發生。)
SEVERE
1000
-
FATAL
1100
FATAL level log messages indicate events that could cause critical service failure and application shutdown and could cause JBoss EAP to shutdown.(FATAL 級別的日誌指示可能導致嚴重服務故障和應用程序關閉以及可能導致 JBoss EAP 關閉的事件。)
OFF
Integer.MAX_VALUE
Does not display any log message.(不顯示任何日誌信息。)
2.日誌格式
類型
描述
%c
The category of the logging event.(日誌事件的類別。)
%p
The level of the log entry (INFO, DEBUG, etc.).(日誌條目的級別(INFO、DEBUG 等)。)
%P
The localized level of the log entry.(日誌條目的本地化級別。)
%d
The current date/time (yyyy-MM-dd HH:mm:ss,SSS format).(當前的日期/時間(yyyy-MM-dd HH:mm:ss,SSS 格式)。)
%r
The relative time (milliseconds since the log was initialized).(相對時間(自日誌初始化後的毫秒數)。)
%z
The time zone, which must be specified before the date (%d). For example, %z{GMT}%d{HH:mm:ss,SSS}.(時區,必須在日期(%d)之前指定。例如,%z{GMT}%d{HH:mm:ss,SSS}。)
%k
A log resource key (used for localization of log messages).(日誌資源關鍵字(用於日誌信息的本地化)。)
%m
The log message (including exception trace).(日誌信息(包含異常跟蹤信息)。)
%s
The simple log message (no exception trace).(簡單日誌信息(不包含異常跟蹤信息)。)
%e
The exception stack trace (no extended module information).(異常棧跟蹤信息(不包含擴展的模塊信息)。)
%E
The exception stack trace (with extended module information).(異常棧跟蹤信息(包含擴展的模塊信息)。)
%t
The name of the current thread.(當前線程的名稱。)
%n
A newline character.(換行符。)
%C
The class of the code calling the log method (slow).(調用日誌方法(慢)的代碼的類。)
%F
The filename of the class calling the log method (slow).(調用日誌方法(慢)的類的文件名。)
%l
The source location of the code calling the log method (slow).(調用日誌方法(慢)的代碼的源碼位置。)
%L
The line number of the code calling the log method (slow).(調用日誌方法(慢)的代碼的行號。)
%M
The method of the code calling the log method (slow).(調用日誌方法(慢)的代碼的方法。)
%x
The Nested Diagnostic Context.(嵌套的診斷性上下文。)
%X
The Message Diagnostic Context.(消息診斷性上下文。)
%%
A literal percent (%) character (escaping)(百分比(%)字符(脫字符)。).
3.過濾器
過濾標籤
描述
accept
Accept all log messages.(接受所有的日誌信息。)
deny
Deny all log messages.(拒絕所有的日誌信息。)
not[filter expression]
Returns the inverted value of a single filter expression.(返回單個過濾器表達式的反轉值) For example:not(match(“WFLY”))
all[filter expression]
Returns concatenated value from a comma-separated list of filter expressions.(返回連接用逗號隔開的過濾器表達式的值) For example:all(match(“WFLY”),match(“WELD”))
any[filter expression]
Returns one value from a comma-separated list of filter expressions.(從用逗號隔開的過濾器表達式列表返回一個值) For example:any(match(“WFLY”),match(“WELD”))
levelChange[level]
Updates the log record with the specified level. (用指定的級別更新日誌記錄)For example:levelChange(WARN)
levels[levels]
Filters log messages with a level listed in the comma-separated list of levels. (過濾用逗號隔開的級別列表裏列出的級別的日誌信息)For example:levels(DEBUG,INFO,WARN,ERROR)
levelRange[minLevel,maxLevel]
Filters log messages within the specified level range. The [ and ] characters are used to indicate an inclusive level. The ( and ) characters are used to indicate an exclusive level.(過濾指定日誌級別範圍內的日誌信息。[ 和 ] 字符用來表示包含的級別。( 和 ) 字符則用來表示排斥的級別) For example:levelRange[INFO,ERROR] The minimum level must be greater than or equal to INFO and the maximum level must be less than or equal to ERROR. levelRange[DEBUG,ERROR) The minimum level must be greater than or equal to DEBUG and the maximum level must be less than ERROR.
match[“pattern”]
Filters log messages using the provided regular expression.(過濾使用提供的常規表達式的日誌信息) For example:match(“WFLY\d+”)
substitute[“pattern”,“replacement value”]
A filter that replaces the first match to the pattern (first argument) with the replacement text (second argument).(用替代文本(第二個參數)替換模式的第一次匹配(第一個參數)的過濾器) For example:substitute(“WFLY”,“EAP”)
substituteAll[“pattern”,“replacement value”]
A filter which replaces all matches of the pattern (first argument) with the replacement text (second argument). (用替代文本(第二個參數)替換模式的所有匹配(第一個參數)的過濾器)For example:substituteAll(“WFLY”,“EAP”)