最簡單的log4j配置檔案
阿新 • • 發佈:2019-01-23
log4j.rootLogger=DEBUG, CONSOLE, FILE ## for console log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout log4j.appender.CONSOLE.layout.ConversionPattern=%d{MM-dd-HH:mm:ss}[%c-%L][%t][%-4r] - %m%n ## for file log4j.appender.FILE=org.apache.log4j.RollingFileAppender log4j.appender.FILE.File=D:/logs/log4j.log log4j.appender.FILE.MaxFileSize=5MB log4j.appender.FILE.Append = true log4j.appender.FILE.layout=org.apache.log4j.PatternLayout log4j.appender.FILE.layout.ConversionPattern=%d{yyyy-MM-dd HH\:mm\:ss} [%t] %-5p %c(line-%L) %-4r %x - %m%n