Alan,

As Yoav mentioned in a previous email, log4j 1.3 (currently marked as alpha-0) has exactly what you are looking for. The method of renaming, archiving, etc are based on strategies and hooks within a special appender extending FileAppender, very similar to what you have described. :-)

At 06:35 PM 4/29/2004, Alan Brown wrote:
Our problem is that our log files grow horribly (and unavoidably)
quickly.  About a gig a day.  So I'd like to put the logs in a more
readable structure.

I don't want to zip the logs at the end of each day because, well,
because they aren't archives yet and they'll still get potentially
plenty of reading from multiple sources.

My concern with having a second process do the pseudo-archiving (ie.
Copying older files to a directory that categorizes it - probably by
day), is that the processes might be trying to manipulate the files at
the same time and potentially throw errors on production (even the older
files could still be in immediate use by the production process, if it's
currently rolling over the log file and therefore renaming all the old
files).

So I'm still leaning toward writing my own subclass of FileAppender that
merges the features of Daily and Rolling, with the Daily part of the
functionality creating new Directories for the 'rolling' functionality
to 'roll' within.

In an ideal world there would be hooks inside FileAppender to enable me
to define my own rolling point and my own archiving method.  Perhaps it
could take a 'strategy' class as an argument that would enable this
functionality, but I can see that would not be easy to design within the
current framework.

alan

-- Ceki G�lc�

For log4j documentation consider "The complete log4j manual"
ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp




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



Reply via email to