我想關閉Spring 3.1的log4j日誌記錄,同時爲我自己的代碼進行調試。如何關閉Spring 3調試日誌記錄?
我試圖堅持這一行到我的log4j.properties:
log4j.category.org.springframework = WARN
爲了得到這個:
# Root Logger Setup: Includes the level of reporting and appenders -> where
# log messages get sent
log4j.rootLogger = DEBUG,ca,fa
log4j.category.org.springframework = WARN
#ca - Console Appender - Send messages to the console
log4j.appender.ca = org.apache.log4j.ConsoleAppender
log4j.appender.ca.layout = org.apache.log4j.PatternLayout
log4j.appender.ca.layout.ConversionPattern = [acme]: [%-5p] - %d{yyyy-MMM-dd HH:mm:ss} - %c{1}:%M(): %m%n
#fa - File Appender - Send messages to a log file
log4j.appender.fa = org.apache.log4j.RollingFileAppender
log4j.appender.fa.File = acme.log
log4j.appender.fa.MaxFileSize = 100KB
log4j.appender.fa.MaxBackupIndex = 10
log4j.appender.fa.Threshold = DEBUG
log4j.appender.fa.layout = org.apache.log4j.PatternLayout
log4j.appender.fa.layout.ConversionPattern = [%-5p] - %d{yyyy-MMM-dd HH:mm:ss} - %c{2}:%M(): %m%n
沒有運氣,雖然切斷從春天輸出的調試。
預先感謝任何幫助
史蒂夫
並確保在類路徑下沒有log4j.xml或log4j.properties文件 – Neron