Should be possible using the maxHistory parameter:<br><br>    &lt;appender name=&quot;file&quot; class=&quot;ch.qos.logback.core.rolling.RollingFileAppender&quot;&gt;<br>        &lt;File&gt;test.log&lt;/File&gt;<br>        &lt;encoder&gt;<br>
            &lt;pattern&gt;... &lt;/pattern&gt;<br>        &lt;/encoder&gt;<br>        &lt;rollingPolicy class=&quot;ch.qos.logback.core.rolling.TimeBasedRollingPolicy&quot;&gt;<br>            &lt;fileNamePattern&gt;test.log.%d{yyyy-MM-dd}.%i&lt;/fileNamePattern&gt;<br>
            &lt;maxHistory&gt;10&lt;/maxHistory&gt;<br>            &lt;timeBasedFileNamingAndTriggeringPolicy class=&quot;ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP&quot;&gt;<br>                &lt;maxFileSize&gt;10MB&lt;/maxFileSize&gt;<br>
            &lt;/timeBasedFileNamingAndTriggeringPolicy&gt;<br>        &lt;/rollingPolicy&gt;<br>    &lt;/appender&gt;<br><br><div class="gmail_quote">On Tue, Apr 5, 2011 at 10:22 PM, Neha Kothari <span dir="ltr">&lt;<a href="mailto:neha.kothari@db.com">neha.kothari@db.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br><font face="sans-serif" size="2">Hi have started to use logback for logging
in java. I am using &quot;TimeBasedRollingPolicy&quot; rolling policy as
I wanted dated logs.</font>
<br>
<br><font face="sans-serif" size="2">My file pattern looks like c:/spg-live.%d{yyyy-MM-dd}.%i.log</font>
<br><font face="sans-serif" size="2">Is there a way that I can put a maxIndex
(i.e the maximum limit for i) using the same rolling policy?</font>
<br>
<br><font face="sans-serif" size="2">Thanks</font>
<br><font face="sans-serif" size="2"><br>
</font>
<br>
<span style="font-family:&#39;Arial&#39;,sans-serif;font-size:8pt;color:#000000">---</span><br>
<span style="font-family:&#39;Courier New&#39;,monospace;font-size:10pt;color:#000000">This communication may contain confidential and/or privileged information.<br>
If you are not the intended recipient (or have received this communication<br>
in error) please notify the sender immediately and destroy this<br>
communication. Any unauthorized copying, disclosure or distribution of the<br>
material in this communication is strictly forbidden.<br>
<br>
Deutsche Bank does not render legal or tax advice, and the information<br>
contained in this communication should not be regarded as such.</span><br>_______________________________________________<br>
Logback-user mailing list<br>
<a href="mailto:Logback-user@qos.ch">Logback-user@qos.ch</a><br>
<a href="http://qos.ch/mailman/listinfo/logback-user" target="_blank">http://qos.ch/mailman/listinfo/logback-user</a><br>
<br></blockquote></div><br>