首页 > 代码库 > log4j.properties

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