log4j.properties的配置示例
时间:2011-06-13 来源:香飘飘2011
# Logger.getLogger("")
log4j.rootLogger = DEBUG,FILE
log4j.appender.FILE =org.apache.log4j.RollingFileAppender
log4j.appender.FILE.encoding=GBK
log4j.appender.FILE.File=C:/logs/bbk_cm.log
log4j.appender.FILE.MaxFileSize = 5MB
log4j.appender.FILE.MaxBackupIndex = 30
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.ConversionPattern=[bbk_cm log] %d{yyyy-MM-dd HH:mm:ss,SSS} <%t> [%-5p] %c - %m%n
log4j.appender.FILE.logfile.layout.ConversionPattern=[bbk_cm log] %d{yyyy-MM-dd HH:mm:ss,SSS} <%t> [%-5p] %c - %m%n
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=[bbk_cm log] %d{yyyy-MM-dd HH:mm:ss,SSS} <%t> [%-5p] %c - %m%n