Log4j不同的Appender,输出不同日志级别的日志内容

log4j.rootLogger=DEBUG,CONSOLE,ROLLING_FILE
###################
# Console Appender#
###################
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Threshold=INFO
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d %p [%c] - %m%n

########################
# Rolling File         #
########################
log4j.appender.ROLLING_FILE=org.apache.log4j.RollingFileAppender
log4j.appender.ROLLING_FILE.Threshold=ERROR
log4j.appender.ROLLING_FILE.File=../log/prada.log
log4j.appender.ROLLING_FILE.MaxFileSize=204800KB
# Keep three backup files.
log4j.appender.ROLLING_FILE.MaxBackupIndex=3
# Pattern to output: date priority [category] - message
log4j.appender.ROLLING_FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.ROLLING_FILE.layout.ConversionPattern=%d %p [%c] - %m%n
log4j.appender.org.apache.commons.digester.Digester.sax=ERROR

你可能感兴趣的:(appender)