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


Attachment: dir-based-rollover.patch
Description: dir-based-rollover.patch

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to