logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ledger, John St W" <stled...@lanl.gov>
Subject Re: RollingFileAppender + TimeBasedRollingPolicy
Date Thu, 14 Oct 2010 13:53:06 GMT

I couldn't find a way to do that either. I made some changes to the DailyRollingFileAppender
class to meet my needs. See the attachment.

This class creates a new log file each day. The log file is in the user directory. Yesterday's
log file is renamed, and then 6 total log files are retained. The maxBackupIndex field controls
how many log files are retained.

Hope this is useful,


From: Corey Scott <corey.scott@gmail.com>
Reply-To: Log4J Users List <log4j-user@logging.apache.org>
Date: Thu, 14 Oct 2010 04:50:55 -0600
To: <log4j-user@logging.apache.org>
Subject: RollingFileAppender + TimeBasedRollingPolicy

  Hi there,

Is there some param i can set in the log4j.xml to have the
TimeBasedRollingPolicy delete old files after x days?
Im sorry if this is handled in the doco and Im too stupid to find it :)


To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org

View raw message