Re: IMPOSSIBLE to do this with LOG4J



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

.



Relevant Pages

  • Re: OpenClipboard
    ... YOU ARE DECLARING LOCAL VARIABLES AND NAMING THEM AS IF THEY ... OpenClipboar, an assertion failure window is pop out, and the program ... buffer to the clipboard, but it doesn't mention what format it is in; ... why you are assuming that it is in CF_BITMAP format. ...
    (microsoft.public.vc.mfc)
  • Re: Naming Conventions - Should I use them?
    ... I wouldn't do any Access programming without naming ... > The "no naming conventions" school of thought seems to be associated with ... > acroynyms to use as prefixes. ... > Doug Steele, Microsoft Access MVP ...
    (microsoft.public.access.tablesdbdesign)
  • Sepahrdic Naming conventions evidently are Dutch!
    ... Dutch Sig list, of my Dutch-Sephardic family's naming conventions, ... All participants, including me, thought this was a Jewish convention, ... going over some old "off-line" Email exchanges about how Dutch ...
    (soc.genealogy.jewish)
  • Re: Class names for starships?
    ... It did seem rather odd that they continued the naming scheme when developing the next vessel, the F-303, which turned out to be rather larger, but I may be misremembering the nomenclature, or it may have been a deliberate attempt to keep the scale of the project under wraps. ... In the Schlock Mercenary webcomic, naming conventions crop up a few times. ... The Russians named their ship Korolev, which makes a little more sense than ...
    (rec.arts.sf.written)
  • Re: cdrecord hangs my computer
    ... actually care about position, so then you are likely happy to go back to ... What's the format for iSCSI? ... The thing is, naming is _hard_, and the only way to name ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)