I've seen a couple of requests for the kind of class I've written at
work, and having cleared it with my boss, I can now release
DatedFileAppender. It's just like a normal FileAppender, but can take a
DatePattern parameter as well (optionally - the default is "yyyyMMdd").
It always writes to a file such as xyz-20010905.log, where the filename
was specified as xyz.log. (I prefer this to just appending the date to
the filename; others may wish to write a patch to allow a more flexible
system, and patch DailyRollingFileAppender in the same way.) An
extension of .log is added if none is specified.
I find this a particularly useful class as it ensures that logs are
*always* rolled over, rather than just when the application is running
at the rollover time. (The class just always makes sure it's writing to
the correct file; a system where there's only one file written but
that's renamed will always have problems working out what to do if
they've got an old file.)
I've used my normal coding style, which I see is slightly different to
the one in some other classes - feel free to adapt it before committing
it :)
Jon
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]