logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sarat kumar <techbeesadig...@gmail.com>
Subject Alternative naming convention for renaming files using RollingFileAppender
Date Tue, 12 May 2009 12:13:19 GMT
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.

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