#develop
log4j.reset=true
log4j.rootLogger=info,Console,business,exception
#release
#log4j.rootLogger=DEBUG
log4j.appender.Console.threshold=DEBUG
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=[%-5p] %d{yyyy-MM-dd HH:mm:ss} %C %M %L %m%n
log4j.appender.business=org.apache.log4j.DailyRollingFileAppender
log4j.appender.business.file=${catalina.base}/logs/BusinessLog.txt
log4j.appender.business.file.datepattern=_yyyy-mm-dd.log
log4j.appender.business.layout=org.apache.log4j.PatternLayout
log4j.appender.business.layout.ConversionPattern=[%-5p] %d{yyyy-MM-dd HH:mm:ss} %C %M %L %m%n
log4j.appender.business.filter.A=org.apache.log4j.varia.LevelRangeFilter
log4j.appender.business.filter.A.LevelMin=DEBUG
log4j.appender.business.filter.A.LevelMax=INFO
log4j.appender.exception.threshold=ERROR
log4j.appender.exception=org.apache.log4j.DailyRollingFileAppender
log4j.appender.exception.file=${catalina.base}/logs/ExceptionLog.txt
log4j.appender.exception.file.datepattern=_yyyy-mm-dd.log
log4j.appender.exception.layout=org.apache.log4j.PatternLayout
log4j.appender.exception.layout.ConversionPattern=[%-5p] %d{yyyy-MM-dd HH:mm:ss} %C %M %L %m%n
java日志配置log4j配置
原创
©著作权归作者所有:来自51CTO博客作者super彦的原创作品,请联系作者获取转载授权,否则将追究法律责任
上一篇:pm2使用文档
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
log4j文件日志配置
下面是一段最常见的日志配置模板:#输出到控制条to console#log4j.rootLogger =
java apache spring ide