logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jon Skeet" <jon.sk...@peramon.com>
Subject RE: Daily Log Files
Date Wed, 05 Sep 2001 07:20:50 GMT
> I've configured an xml based Logger class.  What I'm trying to 
> accomplish now is to have a directory called "Logs", and inside 
> this directory a time stamped log file created daily.  So basically 
> a log file that maintains daily log files.  So today in the Logs 
> directory there would be a log file as follows:

> 09022001.txt
> 09032001.txt
> 09042001.txt

> or better yet:

> Sept042001.txt

> Something for these would be great.  Thanks for any help!

I've written one of these for work as a more robust rolling log file (so
the server doesn't have to be running at midnight to roll over, etc).
I'll see if I can persuade those above me to let me contribute it to the
project. If not, it's fairly simple to do - it's just a case of
extending FileAppender. The tricky bit (in my case) was to have the
FileAppender thinking the filename is one thing (eg log20010904.txt)
while my code knew it was in some sense log.txt (so it could extrapolate
further names). Note that your naming scheme leaves a little to be
desired - YYYYMMDD gives sortability and makes it clear that it's going
to be that rather than YYYYDDMM - I would have misread your names
initially as being the 9th of February, 9th of March etc.


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

View raw message