我似乎沒有將任何INFO級別的消息放入Additions.log或Deletions.log中,即使我看到日誌行在調試器中被執行。這裏是我的log4j.properties文件:log4j:一個班級;同一水平;兩個輸出文件
log4j.file.home=.
log4j.rootLogger=INFO, dest1
log4j.rootCategory=INFO, dest1
log4j.logger.org.hibernate=ERROR
log4j.category.dest1=INFO
log4j.appender.dest1=org.apache.log4j.ConsoleAppender
log4j.appender.dest1.layout=org.apache.log4j.PatternLayout
log4j.appender.dest1.layout.ConversionPattern=%-22d{dd/MMM/yyyy HH:mm:ss} %-8p %c [%t] - %m (%l)%n
#Log items that are being added
log4j.logger.Additions=INFO
log4j.additivity.Additions=false
log4j.appender.Additions=org.apache.log4j.RollingFileAppender
log4j.appender.Additions.File=${log4j.file.home}/Additions.log
log4j.appender.Additions.MaxFileSize=10000KB
log4j.appender.Additions.MaxBackupIndex=10
log4j.appender.Additions.layout=org.apache.log4j.PatternLayout
log4j.appender.Additions.layout.ConversionPattern=%-22d{dd/MMM/yyyy HH:mm:ss} %-8p %c [%t] - %m (%l)%n
#Log items that are being removed
log4j.logger.Deletions=INFO
log4j.additivity.Deletions=false
log4j.appender.Deletions=org.apache.log4j.RollingFileAppender
log4j.appender.Deletions.File=${log4j.file.home}/Deletions.log
log4j.appender.Deletions.MaxFileSize=10000KB
log4j.appender.Deletions.MaxBackupIndex=10
log4j.appender.Deletions.layout=org.apache.log4j.PatternLayout
log4j.appender.Deletions.layout.ConversionPattern=%-22d{dd/MMM/yyyy HH:mm:ss} %-8p %c [%t] - %m (%l)%n
,這裏是從類讓我的記錄器:
private static Logger addLog = Logger.getLogger("Additions");
private static Logger deleteLog = Logger.getLogger("Deletions");
還有什麼我需要解決算出這個?