You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Shiva Cheedella <SC...@kodiaknetworks.com> on 2005/11/18 00:44:34 UTC

RollingFileAppender and DailyFileAppender combo usage

 

All,

 

 

We use log4j and our logs volume is generally 200MB of data in a single
day, and Presently we use 'RollingFileAppender', as everybody knows
after the max files is reached - the old logs are gone

 

Present configuration we have is:

 

log4j.appender.R=org.apache.log4j.RollingFileAppender

log4j.appender.R.File=Log.txt

log4j.appender.R.MaxFileSize=10MB

log4j.appender.R.MaxBackupIndex=20

log4j.appender.R.layout=org.apache.log4j.TTCCLayout

log4j.appender.R.layout.ContextPrinting=enabled

log4j.appender.R.layout.DateFormat=ISO8601

 

As seen from the above configuration - we will be generating around 20
Files with 10MB each slice and after that it starts rolling over or in
other words old log data is gone, but in busy days the 20 files are over
in half day itself and if any customer has issues - by the time the
trouble ticket reaches us it takes a day and most of the time customer's
logs are gone, of course we can increase the backupindex to may be 50,
but this is like guesstimate of the load conditions

 

 

The other option being is to use DailyRollingFileAppender but our logs
generated are generally 200MB of data - which is very huge in a single
file per day, hence cannot be useful either

 

Hence was wondering are there any configurations or options to achieve
the below behavior:

 

The logs directory snapshot:

 

 Log.txt

 Log.txt.1

 Log.txt.2

 Log.txt.3

 Log.txt.4

 Log.txt.5

 Log.txt.6

 ...

 ...

 Log.txt.20

 Log.txt:17:2005_3:35:14:829

 

 

What the above snapshot means is: Once the max backup index is reached
instead of rolling over the file is moved to a different file format -
if this is possible, then we can write a cron or simple script which
periodically checks for the 'date format' log files and move them to a
central log server or compress them and move to a different disk space

 

Any pointers or suggestions are appreciated

 

Shiva

 

The information contained in this message may be confidential to Kodiak Networks, Inc. and its subsidiaries and protected from disclosure. If this message did not reach the intended recipient, or an employee or agent responsible for delivering it to the intended recipient, you are hereby informed that any distribution or copying of this communication is prohibited. If you have received this communication in error, please notify us immediately by replying to the sender of the message and then delete the message. Thank you.