java日誌設定及常用配置
阿新 • • 發佈:2019-01-08
log4j.rootLogger=WARN,A2,A3
log4j.logger.test=DEBUG
log4j.appender.A2=org.apache.log4j.RollingFileAppender
log4j.appender.A2.File=../logs/test.log
log4j.appender.A2.Encoding=UTF-8
log4j.appender.A2.Append=true
log4j.appender.A2.MaxFileSize=2MB
log4j.appender.A2.MaxBackupIndex=5
log4j.appender.A2.layout=org.apache .log4j.PatternLayout
log4j.appender.A2.layout.ConversionPattern=%-5p %d [%t] %c{3}.%M - %m%n
log4j.additivity.test.xml=false
log4j.logger.test.xml=DEBUG,A3
log4j.appender.A3=org.apache.log4j.RollingFileAppender
log4j.appender.A3.File=../logs/test-xml.log
log4j.appender.A3.Encoding=UTF-8
log4j.appender.A3.Append =true
log4j.appender.A3.MaxFileSize=2MB
log4j.appender.A3.MaxBackupIndex=5
log4j.appender.A3.layout=org.apache.log4j.PatternLayout
log4j.appender.A3.layout.ConversionPattern=%-5p %d [%t] %c{3}.%M - %m%n
log4j.logger.test=DEBUG
log4j.appender.A2=org.apache.log4j.RollingFileAppender
log4j.appender.A2.File=../logs/test.log
log4j.appender.A2.Encoding=UTF-8
log4j.appender.A2.Append=true
log4j.appender.A2.MaxFileSize=2MB
log4j.appender.A2.MaxBackupIndex=5
log4j.appender.A2.layout=org.apache
log4j.appender.A2.layout.ConversionPattern=%-5p %d [%t] %c{3}.%M - %m%n
log4j.additivity.test.xml=false
log4j.logger.test.xml=DEBUG,A3
log4j.appender.A3=org.apache.log4j.RollingFileAppender
log4j.appender.A3.File=../logs/test-xml.log
log4j.appender.A3.Encoding=UTF-8
log4j.appender.A3.Append
log4j.appender.A3.MaxFileSize=2MB
log4j.appender.A3.MaxBackupIndex=5
log4j.appender.A3.layout=org.apache.log4j.PatternLayout
log4j.appender.A3.layout.ConversionPattern=%-5p %d [%t] %c{3}.%M - %m%n