Discussion:
Daily Rolling File Appender Max backup index settings
pushkar sawant
2011-04-24 14:35:13 UTC
Permalink
Hi,



Is there a parameter setting available for configuring Max Backups stored on
the disk for DailyRollingFileAppender?



I have a jboss instance running and am trying to configure log4j.xml file to
limit number of backups stored on the disk. I went through some blogs and
found a parameter “MaxBackupIndex” to limit number of files. But this
setting is not working for me.



Also on wiki under the requested feature page (
http://wiki.apache.org/logging-log4j/Log4jRequestedFeatures), i see this
feature listed.


Has this feature been implemented? Is there any place where I can see why
this is failing.



I am using following log4j.xml file.



Thanks







<appender name="FILE"
class="org.jboss.logging.appender.DailyRollingFileAppender">

<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>

<param name="File" value="${jboss.server.log.dir}/server.log"/>

<param name="Append" value="true"/>

<param name="MaxBackupIndex" value="10"/>

<!-- Rollover at midnight each day -->

<param name="DatePattern" value="'.'yyyy-MM-dd"/>



<!-- Rollover at the top of each hour

<param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>

-->



<param name="Threshold" value="ERROR"/>



<layout class="org.apache.log4j.PatternLayout">

<!-- The default pattern: Date Priority [Category] Message\n -->

<param name="ConversionPattern" value="%d{DATE} %-5p [%c] %m%n"/>



<!-- The full pattern: Date MS Priority [Category] (Thread:NDC)
Message\n

<param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x)
%m%n"/>

-->

</layout>

</appender>

Loading...