logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guy <guy.van.tilbo...@gmail.com>
Subject Re: Alternative naming convention for renaming files using RollingFileAppender
Date Tue, 12 May 2009 12:27:34 GMT
Hi Sarat,

You could always write the custom Appender yourself. I did because I needed
to be able to rollover and zip the rollover file to limit disk space
occupied (and some other custom behavior).

If you like I could post code, but first I have to figure out how I did it
myself :-)

kind regards


On Tue, May 12, 2009 at 2:13 PM, sarat kumar <techbeesadigest@gmail.com>wrote:

> Hi all,
> I have a question on the renaming strategy followed in the
> RollingFileAppender in log4j. The current logic works by rolling over the
> current file by appending the index count at the end. I was wondering if
> there's a custom appender available which can allow me to customize the
> renaming strategy followed while rolling over to a new file.
> Basically, the requirement I have is that.. I need to rollover to new log
> file if it reaches a threshold size and when I rollover, the old file
> should
> be renamed with a timestamp in it. After going through the documentation I
> figured out the daily appender does the job I want by adding timestamp at
> the end of the file name, but it can't rollover the file based on its size.
> I also searched in couple of forums that I know and found no fruitful
> results.
> Finally, I have checked the source code and figured out the 'rollover'
> method typically hard codes logic to rollover the current file with
> appending the index information to it. So, i guess my option is only to
> look
> for third party appenders which can provide this functionality.
> Can anyone point me to the right direction here ? if you know any third
> party log4j appenders which can address this issue, it'd be of great help
> for me.
> Thanks in advance for your replies.
> Regards,
> Sarat kumar Beesa.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message