# Global logging configurationlog4jrootLogger=DEBUG stdout# Console outputlog4jappenderstdout=orgapachelog4jConsoleAppenderlog4jappenderstdoutlayout=orgapachelog4jPatternLayoutlog4jappenderstdoutlayou
File output...
log4j.appender.file=org.apache.log4j.RollingFileAppender log4j.appender.file.File=/var/log/myapp.log log4j.appender.file.MaxFileSize=10MB log4j.appender.file.MaxBackupIndex=10 log4j.appender.file.layout=org.apache.log4j.PatternLayout log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %5p [%t] %c{1}:%L - %m%n
Set the logger level for a specific package
log4j.logger.com.mycompany=INFO
Set the logger level for a specific class
log4j.logger.com.mycompany.MyClass=DEBU
原文地址: https://www.cveoy.top/t/topic/fljx 著作权归作者所有。请勿转载和采集!