logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Sanders <dsand...@chaincast.com>
Subject DailyRollingFileAppender - roll at scheduled time instead of when record written
Date Wed, 30 Oct 2002 02:05:08 GMT
With DailyRollingFileAppender, how do I cause files to be rolled over on 
the configurable interval instead of waiting for the first log write 
attempt after the interval expires?


 > DailyRollingFileAppender extends FileAppender so that the underlying 
file is rolled over at a user chosen frequency.
 >For example, if the File option is set to /foo/bar.log and the 
DatePattern set to '.'yyyy-MM-dd, on 2001-02-16 at midnight, the logging 
file >/foo/ bar.log will be copied to /foo/bar.log.2001-02-16 and logging 
for 2001-02-17 will continue in /foo/bar.log until it rolls over the next day.

The file won't be rolled on 2001-02-16 at midnight unless a message is 
logged at midnight.  Instead, the file will be rolled when the first log 
message is written after midnight.  In my application, that "first message" 
could be several hours after midnight.  Yet, I need the log file closed 
(and preferably renamed) at midnight so the log can be processed by another 

To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>

View raw message