logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arne Vandamme <a...@foreach.be>
Subject Contribution to RollingFileAppender (log4j-extras)
Date Tue, 24 Jan 2012 08:36:49 GMT
Hi,

This applies to log4j-extras (1.1).
We use the RollingFileAppender with TimeBasedRollingPolicy in several of our applications.
 But we like to group all logfiles on date in separate directories.  In our case it's simply
because it's easier to browse them that way.

Eg:

-          2011/05/05/

o   pages.log

o   methods.log

-          2011/05/06/

o   pages.log

o   methods.log

Apparently the RollingFileAppender does not rollover in this case because the parent directories
do not exist and the RollingFileAppender does not try to create them.
In attach a small patch file that modifies RollingFileAppender to create all parent directories
in case of a rollover (+ a small test added to TimeBasedRollingPolicy).

I do not know if this is eligible or useful to be added to the trunk of log4j-extras.  It
would be handy to know in order to know to switch back to either snapshot or a release of
the extras lib.  Not that I'm expecting a new stable release anytime soon ;-)

Best regards,
Arne Vandamme



Mime
View raw message