On Feb 7, 2009, at 12:40 PM, Mayer István János wrote:
Hi,
I use log4J 1.3 (becouse the application will run under os4690 and
there are java 1.4)
log4j 1.3 is a dead branch. Several features from log4j 1.3 have been
back-ported to work with log4j 1.2. You can use it if you want, but
there is no anticipated further development and limited support
available.
I tried to split the logs into different files by level. The result
was strange all the .log contain all the log lines.
My config files was this:
log4j.rootLogger=ALL, Timer, ErrorReport, InfoReport
#################
# Timer
#################
log4j.appender.Timer=org.apache.log4j.DailyRollingFileAppender
log4j.appender.Timer.file=C:/AMROFILER/Report/Timer.log
log4j.appender.Timer.file.DatePattern='.'yyyyMMdd
log4j.appender.Timer.Append=true
log4j.appender.Timer.file.MaxBackupIndex=10
log4j.appender.Timer.layout=org.apache.log4j.PatternLayout
log4j.appender.Timer.layout.ConversionPattern=%-5p [%10t]
%d{yyyy.MM.dd HH:mm:ss,SSS} %-20.20c %m%n
#################
# Error Report
#################
log4j.appender.ErrorReport=org.apache.log4j.DailyRollingFileAppender
log4j.appender.ErrorReport.file.DatePattern='.'yyyyMMdd
log4j.appender.ErrorReport.file=C:/AMROFILER/Report/Error.log
log4j.appender.ErrorReport.file.MaxBackupIndex=10
log4j.appender.ErrorReport.Append=true
log4j.appender.ErrorReport.file.Threshold=ERROR
log4j.appender.ErrorReport.layout=org.apache.log4j.PatternLayout
log4j.appender.ErrorReport.layout.ConversionPattern=%-5p [%10t]
%d{MM.dd HH:mm:ss} %m%n
#################
# Info Report
#################
log4j.appender.InfoReport.file.Threshold=INFO
log4j.appender.InfoReport=org.apache.log4j.DailyRollingFileAppender
log4j.appender.InfoReport.file.DatePattern='.'yyyyMMdd
log4j.appender.InfoReport.file=C:/AMROFILER/Report/Info.log
log4j.appender.InfoReport.Append=true
log4j.appender.InfoReport.file.MaxBackupIndex=10
log4j.appender.InfoReport.layout=org.apache.log4j.PatternLayout
log4j.appender.InfoReport.layout.ConversionPattern=%-5p [%10t]
%d{MM.dd HH:mm:ss} %m%n
What is wrong inside?
You have a stray "file." in your Threshold and DatePattern property
names. The threshold is a lower bound, so if you correct the property
names, you will have info and error messages in the Info report. If
you really want to isolate each level in a different file, then you
can use the LevelMatchFIlter.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]