Looks good.
One question and one small doc bug:
Question: How do you really ensure all of one days logs are in the file
before you copy them after midnight?
Do you avoid buffering and use immediate writes? Because if you use
buffering and if the last Logger.error() was called
at 11:59, but didn't fill the buffer, and the next Logger.error() call
wasn't made for hours, then a copy at 12:10 might not contain the last log
entry (since it could still be in the buffer).
Or am I missing something?
Small doc nit: The example in the javadocs concerning the BufferSize is a
cut/paste from BufferedIO boolean.
Here's the section:
# BufferSize: sets the size of the buffer to use if BufferedIO is true.
# The default size is 8K.
#log4j.appender.T.BufferedIO=8192
--
Tom Goetze
minaret <[EMAIL PROTECTED]>
09/06/2004 09:39 AM
Please respond to "Log4J Users List"
To: [EMAIL PROTECTED]
cc:
Subject: New Log4j appender available
I have written a new Log4j appender (DatedFileAppender) that works in the
same manner as the Tomcat FileLogger. That is, log file names always
contain
today's date instead of being renamed in the manner of the
DailyRollingFileAppender. While this distinction seems minor, it means you
can reliably copy, compress, remove or manipulate a day's log file shortly
after midnight. With the DailyRollingFileAppender, a day's log file is not
renamed until the first message is logged some time after midnight.
The software and accompanying documentation is available here:
http://minaret.biz/tips/datedFileAppender.html
For those of you using Tomcat, I also wrote up a technical tip on Tomcat
logging and using Log4j with Tomcat (with tips for Velocity users). Please
see:
http://minaret.biz/tips/tomcatLogging.html