Re: IMPOSSIBLE to do this with LOG4J
- From: Abhijat Vatsyayan <abhijat.vatsyayan@xxxxxxx>
- Date: Fri, 29 Apr 2005 16:13:28 -0400
A quick fix will be to subclass from RollingFileAppender and override
method "public void rollOver() ". You may have to embed your naming
conventions in the implementation or you could get some information from
configuration. Get the date format, file name format
(filename-<date>-<count>.log ) etc. from log4j configuration. Then
implement naming conventions that use this information. It really is up to
you!
ProgDario wrote:
> HI,
>
> my customer asked me to log the application events with a rotation file
> appenderm, a new file is created when the previous file reachs a
> certain size.
>
> 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.
>
> Morover, every file name must contain the date time in its path.
>
> 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
>
> Any hint??
>
> Thanks!!
>
> :)ario
.
- References:
- IMPOSSIBLE to do this with LOG4J
- From: ProgDario
- IMPOSSIBLE to do this with LOG4J
- Prev by Date: Re: Static initilizer failed to execute?
- Next by Date: Re: Calling a Web Service using Axis, from within an Axis Web Service running under Tomcat
- Previous by thread: Re: IMPOSSIBLE to do this with LOG4J
- Next by thread: java seems not to find a class from rt.jar ;)
- Index(es):
Relevant Pages
|
|