#root logger config starts
log4j.rootLogger=INFO, RA
log4j.appender.RA=org.apache.log4j.RollingFileAppender
log4j.appender.RA.File=/Data/var/logs/root.log
log4j.appender.RA.MaxFileSize=100KB
# Keep one backup file
log4j.appender.RA.MaxBackupIndex=1
log4j.appender.RA.layout=org.apache.log4j.PatternLayout
log4j.appender.RA.layout.ConversionPattern=%p %d - %m%n
# root config logger ends
#ico common logger config starts
log4j.logger.com=INFO, COMMONA
log4j.appender.COMMONA=org.apache.log4j.RollingFileAppender
log4j.additivity.com=false
log4j.appender.COMMONA.File=/Data/var/logs/common_ico.log
log4j.appender.COMMONA.MaxFileSize=100KB
# Keep one backup file
log4j.appender.COMMONA.MaxBackupIndex=1
log4j.appender.COMMONA.layout=org.apache.log4j.PatternLayout
log4j.appender.COMMONA.layout.ConversionPattern=[%x]%p %d - %m%n
#ico common logger config ends
以上配置有效。我正在使用log4j.additivity.COMMONA=false
而不是log4j.additivity.com=false