Hi Andy, Looks like the MaxBackupIndex is hardcoded to 12 for log4cxx as the renaming of all the files is required for every rollover.
Here is the email form Dale sometime back on the similar issue. Hope this helps ============================================================== On Wed, Jul 16, 2008 at 4:33 PM, Peter Steele <[EMAIL PROTECTED]> wrote: > We use a RollingFileAppender defined as follows: > > > > <appender name="FILE" class="org.apache.log4j.RollingFileAppender"> > > <param name="maxFileSize" value="200MB" /> > > <param name="maxBackupIndex" value="20" /> > > <param name="File" value="${LOGNAME}" /> > > <param name="Append" value="false"/> > > <layout class="org.apache.log4j.PatternLayout"> > > <param name="ConversionPattern" > > value="%d{MM-dd HH:mm:ss.SSS} %5p %c{1} - %m%n" /> > > </layout> > > </appender> > > > > It works fine, except that the maxBackupIndex appears to top out at > 13, even though we have 20 specified. Are we doing something wrong or > is 13 a hard coded maximum for this field? 12 is a hardcoded limit because this requires renames of all backup files which is expensive . -- Dale King ======================================================================= -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, October 31, 2008 5:09 AM To: log4cxx-user@logging.apache.org Subject: Problem with RollingFileAppender only retaining 14 files. Hi, We have been using log4j in our Java applications for some time and they seem to work fine. We have a single application written in C++ which is now using log4cxx 0.10.0. I have setup an appender as follows <appender name="file" class="org.apache.log4j.RollingFileAppender"> <param name="Threshold" value="DEBUG"/> <param name="File" value="e:/iqbonds_uat_egb362/logs/CurveBlender/CurveBlender.log" /> <param name="Append" value="true" /> <param name="MaxFileSize" value="10MB"/> <param name="MaxBackupIndex" value="50"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d %-5p %c{1} - %m%n"/> </layout> </appender> It seems to work fine except it is ignoring the MaxBackupIndex parameter because once it gets to 13 files it deletes the oldest files. So I have files like app.log, app.log.1 ..... app.log.13 but when it rolls it deletes app.log.13. Any help would be appreciated. Thanks Andy Generally, this communication is for informational purposes only and it is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction. In the event you are receiving the offering materials attached below related to your interest in hedge funds or private equity, this communication may be intended as an offer or solicitation for the purchase or sale of such fund(s). All market prices, data and other information are not warranted as to completeness or accuracy and are subject to change without notice. Any comments or statements made herein do not necessarily reflect those of JPMorgan Chase & Co., its subsidiaries and affiliates. This transmission may contain information that is privileged, confidential, legally privileged, and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. Although this transmission and any attachments are believed to be free of any virus or other defect that might affect any computer system into which it is received and opened, it is the responsibility of the recipient to ensure that it is virus free and no responsibility is accepted by JPMorgan Chase & Co., its subsidiaries and affiliates, as applicable, for any loss or damage arising in any way from its use. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Thank you. Please refer to http://www.jpmorgan.com/pages/disclosures for disclosures relating to UK legal entities.