B
Brett Sheeran
Hi I am using log4j 1.2.8 with Tomcat. I am trying to log errors to daily
files using DailyRollingFileAppender. The current days logs are saved to
file. However, I am finding that the previous days logs are not being saved
to file. I have a copy of my properties file below. Can anyone tell me why
this is happening?
Thanks.
Regards Brett Sheeran
# Set root logger level to DEBUG and its only appender to A1.
log4j.rootCategory=DEBUG, A1, A2
# A1 is set to be a ConsoleAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern= %-5p %c - %m%n
# set appender A2 as file appender
log4j.appender.A2=org.apache.log4j.DailyRollingFileAppender
log4j.appender.A2.File=c:/WebReports/Logs/campbells.log
log4j.appender.A2.DatePattern='.'yyyy-MM-dd
log4j.appender.A2.layout=org.apache.log4j.PatternLayout
log4j.appender.A2.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
log4j.appender.A2.MaxFileSize=10MB
files using DailyRollingFileAppender. The current days logs are saved to
file. However, I am finding that the previous days logs are not being saved
to file. I have a copy of my properties file below. Can anyone tell me why
this is happening?
Thanks.
Regards Brett Sheeran
# Set root logger level to DEBUG and its only appender to A1.
log4j.rootCategory=DEBUG, A1, A2
# A1 is set to be a ConsoleAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern= %-5p %c - %m%n
# set appender A2 as file appender
log4j.appender.A2=org.apache.log4j.DailyRollingFileAppender
log4j.appender.A2.File=c:/WebReports/Logs/campbells.log
log4j.appender.A2.DatePattern='.'yyyy-MM-dd
log4j.appender.A2.layout=org.apache.log4j.PatternLayout
log4j.appender.A2.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
log4j.appender.A2.MaxFileSize=10MB