logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Fleiter <stefan.flei...@web.de>
Subject Contribution of TimedDailyRollingFileAppender or CronExpressionFileAppender
Date Mon, 28 Jan 2008 16:30:16 GMT
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: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message