logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Don Taylor <donald_l_taylor...@yahoo.com>
Subject Re: daily log file question
Date Wed, 08 Aug 2001 16:31:32 GMT
--- Aron Kramlik <aron.kramlik@itouch.com.au> wrote:
> Hi,
> 
> I would like to ask if the DailyRollingFileAppender is the class that
> is
> meant to be used for log files that need to be rolled every day.

It is.

> I have seen some discussion in the archives and I am not sure it
> is production ready from the discussions - could you please advise
> if this is considered ready to be used in production?  Also, a simple
> example, or pointer to an example, of how one can go about using it.
> 
> Thanks,
> 
> Aron Kramlik
> aron.kramlik@itouch.com.au
> 

Most of the discussion involves it not working the way you really want.
I have a version that's in production that does what most people want,
but it's only been in production a couple of weeks. I'm planning on
posting it to the group this weekend, after it's cleaned-up some
(getting it up to the coding standards, placing it in the right
package, and so on.) In the meantime, go ahead and use the existing
DailyRollingFileAppender.

The problems my version resolves:

1. DailyRollingFileAppender will not rollover the log file if the
application isn't running at the time of the rollover.

(Actually, a fix to this has already been posted. I've just
incorporated it in my version.)

2. DailyRollingFileAppender does not use the date/time stamp in the
file name for the currently active logging file.

3. DailyRollingFileAppender always appends the date/time stamp to the
filename, rather than determining if an extension exists and inserting
the date/time stamp just before the extension. This really helps when
viewing the log file in extension-oriented systems such as Windows.

4. DailyRollingFileAppender does not limit the maximum number of logs
that can be created. It'll create logs forever. My version does the
same thing, but you can optionally set a limit. (You can't limit the
size, only the number.)

5. DailyRollingFileAppender doesn't work well with layouts such as
HTMLLayout. Everytime you start a logging session a header is sent to
the log. That makes an HTML file a mess. My version allows you to
specify how to handle the header when appending to an already-existing
log.

Is DailyRollingFileAppender ready for production? Sure, just pay
attention to the caveats. If you're interested in my version, give me a
couple of days to clean it up and get it posted. In the meantime, just
use DailyRollingFileAppender.

As far as pointers on how to use DailyRollingFileAppender, re-read the
documentation with the above caveats in mind. Hopefully it will make
things much clearer for you.

-- Don

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


Mime
View raw message