Re: IMPOSSIBLE to do this with LOG4J
- From: Thomas Schodt <spamtrap@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 29 Apr 2005 16:09:33 +0100
ProgDario wrote:
... log the application events with a rotation file appenderm, a new file is created when the previous file reachs a certain size.
Which matches RollingFileAppender.
The subtle thing is that when the maximum number of file is reached, the old one must me deleted and a new file has to be created.
Still matches RollingFileAppender.
Morover, every file name must contain the date time in its path.
If the current file need not have this, this matches DailyRollingFileAppender.
So if the file size limit is 4 and a new file is created, the first file is erased, and the new file name created contains the date/time detail:
[FileName_29-04-05_12:12:12.log] -> erased FileName_29-04-05_12:17:05.log FileName_29-04-05_12:22:45.log FileName_29-04-05_12:35:45.log FileName_29-04-05_12:50:01.log -> new file created
Apache is open source.
Look at the two [RollingFileAppender, DailyRollingFileAppender]. Maybe you can figure out how to implement a combination of the two.
Have a look at existing 3rd party extensions <http://logging.apache.org/log4j/docs/download.html> maybe someone already did it. .
- References:
- IMPOSSIBLE to do this with LOG4J
- From: ProgDario
- IMPOSSIBLE to do this with LOG4J
- Prev by Date: Re: java seems not to find a class from rt.jar ;)
- Next by Date: Re: Out of memory error
- Previous by thread: IMPOSSIBLE to do this with LOG4J
- Next by thread: Re: IMPOSSIBLE to do this with LOG4J
- Index(es):