posted 16 years ago
Hi Friends,
I am using DailyRollingFileAppender to make a log file for a specific logger.
Below is a part of my log file.
# dailyLog is the DailyRollingFileAppender.
log4j.logger.daily.com.XXX.YYY.Process.ProcessManager=dailyLog
log4j.additivity.daily.com.XXX.YYY.Process.ProcessManager=false
log4j.appender.dailyLog=org.apache.log4j.DailyRollingFileAppender
log4j.appender.dailyLog.Threshold=debug
log4j.appender.dailyLog.File=\logs/DailyReport/DailyReport.log
log4j.appender.dailyLog.append = true
log4j.appender.dailyLog.DatePattern='.'yyyy-MM-dd
log4j.appender.dailyLog.layout=org.apache.log4j.PatternLayout
log4j.appender.dailyLog.layout.ConversionPattern=%d[%t] %-5p %c - %m%n
with this log file i am able to create a log file but the next day, when running the application the following error occurs and no new log file is created.
java.lang.NullPointerException
at org.apache.log4j.WriterAppender.subAppend(WriterAppender.java:292)
at org.apache.log4j.DailyRollingFileAppender.subAppend(DailyRollingFileAppender.java:343)
at org.apache.log4j.WriterAppender.append(WriterAppender.java:150)
at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:221)
at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:57)
at org.apache.log4j.Category.callAppenders(Category.java:190)
at org.apache.log4j.Category.forcedLog(Category.java:375)
at org.apache.log4j.Category.info(Category.java:696)
If i delete the log file of the previous day, the application works fine, but in presence of previous' day log file, no rolling of file takes place.
Please help me in figuring out what i am missing.
Thanks.