log4j.properties
Posted 悟空救我呀
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了log4j.properties相关的知识,希望对你有一定的参考价值。
### set log levels ### log4j.rootLogger = INFO, stdout , D , E ### \u8F93\u51FA\u5230\u63A7\u5236\u53F0 ### log4j.appender.stdout = org.apache.log4j.ConsoleAppender log4j.appender.stdout.Threshold = Debug log4j.appender.stdout.Target = System.out log4j.appender.stdout.layout = org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern = %d{ABSOLUTE} %5p %c{1}:%L - %m%n ### \u8F93\u51FA\u5230\u65E5\u5FD7\u6587\u4EF6 ### log4j.appender.D = org.apache.log4j.DailyRollingFileAppender log4j.appender.D.Encoding=UTF-8 log4j.appender.D.File = ${LOG_DIR}/log/log.html ##log4j.appender.D.File = null/log/log.log log4j.appender.D.Append = true log4j.appender.D.Threshold = Debug ## \u8F93\u51FADEBUG\u7EA7\u522B\u4EE5\u4E0A\u7684\u65E5\u5FD7 ## log4j.appender.D.layout = com.core.HtmlLogFormat #log4j.appender.D.layout = org.apache.log4j.HTMLLayout ##log4j.appender.D.layout = org.apache.log4j.PatternLayout ##log4j.appender.D.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss} [ %t:%r ] - [ %p ] %m%n ### \u4FDD\u5B58\u5F02\u5E38\u4FE1\u606F\u5230\u5355\u72EC\u6587\u4EF6 ### log4j.appender.E = org.apache.log4j.DailyRollingFileAppender log4j.appender.E.File = ${LOG_DIR}/log/error.log ##log4j.appender.E.File = null/log/error.log ## \u5F02\u5E38\u65E5\u5FD7\u6587\u4EF6\u540D ## log4j.appender.E.Append = true log4j.appender.E.Threshold = ERROR ## \u53EA\u8F93\u51FAERROR\u7EA7\u522B\u4EE5\u4E0A\u7684\u65E5\u5FD7!!! ## log4j.appender.E.layout = org.apache.log4j.PatternLayout log4j.appender.E.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss} [ %t:%r ] - [ %p ] %m%n
以上是关于log4j.properties的主要内容,如果未能解决你的问题,请参考以下文章
将 log4j.properties 文件从 Log4j 版本 1 迁移到 2 的合适指南