Hello,

we think that Log4j is missing a possibility to rollover at a fixed time of the 
day
and have developed a TimedDailyRollingFileAppender class which does this.

We would like to contribute the solution to the log4j project.

If there is interest in this class we could factor out the similarities
with DailyRollingFileAppender and send a patch.
The class can be configured like this:

log4j.appender.file=org.apache.log4j.TimedDailyRollingFileAppender
log4j.appender.file.File=${filename}
log4j.appender.file.RolloverHour=5
log4j.appender.file.RolloverMinute=55


Alternatively, if this is not flexible enough, we could extend the 
configurability
by converting this class to a CronExpressionFileAppender which accepts
a cron expression for rollover:

log4j.appender.file=org.apache.log4j.TimedDailyRollingFileAppender
log4j.appender.file.File=${filename}
log4j.appender.file.RolloverCronExpression=0 55 5 * * *

To do this we would depend on CronExpression from Quartz:
http://svn.opensymphony.com/fisheye/viewrep/quartz/trunk/src/java/org/quartz/CronExpression.java
Quartz is licensed under the Apache License, Version 2.0, so this should be no 
problem.

What do you think?

Greetings,
Stefan Fleiter



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to