您的位置:首页 > 其它

log4j,logback,sl4j常用日志格式详解

2017-10-21 23:17 821 查看
%d{HH:mm:ss.SSS}:    打印日期 ------------ utputs the date of the logging event. )

%p: 打印日志级别  ------------   Outputs the level of the logging event.

%c{40}:打印日志内容 ----------- Outputs the name of the logger that published the logging event.

%C: 打印调用日志所在类名字 ----------- Outputs the fully qualified class name of the caller issuing the logging request. may impact performance

%t:打印线程----------- Outputs the name of the thread that generated the logging event.)

%m:打印log 信息 ------------- Outputs the application supplied message associated with the logging event.)

%M: 打印方法名称 ------------ Outputs the method name where the logging request was issued.

%n:换行----------Outputs the platform dependent line separator character or characters.)

%L:打印日志所在行  -------- Outputs the line number from where the logging request was issued.may impact performance)
%highlight:  指定日志信息高亮  --------  Adds ANSI colors to the result of the enclosed pattern based on the current event's logging level.

参考链接:

http://logging.apache.org/log4j/2.x/manual/layouts.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: