log4j

前端之家收集整理的这篇文章主要介绍了log4j前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

RollingFileAppender和DailyRollingFileAppender

RollingFileAppender:按log文件最大长度限度生成文件
DailyRollingFileAppender:按日期生成文件

# Root logger set to ERROR using the Console appender defined above. 
# log level : ALL DEBUG INFO WARN ERROR OFF 
# INFO  %d{yyyy-MM-dd HH:mm:ss} %m%n
# OTHER %d{yyyy-MM-dd HH:mm:ss} [%t] [%c] %p: %m%n
log4j.rootLogger=INFO,CONSOLE,X5

###################

Console Appender

###################
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Target=System.out
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %m%n
########################

X5 File

########################
log4j.appender.X5=org.apache.log4j.RollingFileAppender
log4j.appender.X5.File=${JUSTEP_LOG_HOME}/justep.baas.log
log4j.appender.X5.MaxFileSize=10MB
log4j.appender.X5.MaxBackupIndex=10
log4j.appender.X5.layout=org.apache.log4j.PatternLayout
log4j.appender.X5.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} [%t] [%c] %p: %m%n

原文链接:https://www.f2er.com/note/422114.html

猜你在找的程序笔记相关文章