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”)