log4j的配置文件例子

来源:转载

log4j的配置文件例子,非常方便的一个开源日志软件,一直用它

log4j.properties

log4j.rootLogger=info, A1 , R
log4j.appender.A1=org.apache.log4j.ConsoleAppender
#log4j.appender.A1.layout=org.apache.log4j.HTMLLayout
#log4j.appender.A1.layout=org.apache.log4j.SimpleLayout
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss} [%c]-[%p] %m%n
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=g:/Program Files/Apache Software Foundation/Tomcat 5.5/logs/JDS001-log/log4j.log
log4j.appender.R.MaxFileSize=100KB
log4j.appender.R.MaxBackupIndex=1
log4j.appender.R.layout=org.apache.log4j.PatternLayout
#log4j.appender.R.layout=org.apache.log4j.DailyRollingFileAppender
#log4j.appender.R.layout.ConversionPattern=%p -thread: %t - %l - %c - %m%n
log4j.appender.R.layout.ConversionPattern=%p - %l - %m%n



分享给朋友:
您可能感兴趣的文章:
随机阅读: