Should be possible using the maxHistory parameter:<br><br> <appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender"><br> <File>test.log</File><br> <encoder><br>
<pattern>... </pattern><br> </encoder><br> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"><br> <fileNamePattern>test.log.%d{yyyy-MM-dd}.%i</fileNamePattern><br>
<maxHistory>10</maxHistory><br> <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"><br> <maxFileSize>10MB</maxFileSize><br>
</timeBasedFileNamingAndTriggeringPolicy><br> </rollingPolicy><br> </appender><br><br><div class="gmail_quote">On Tue, Apr 5, 2011 at 10:22 PM, Neha Kothari <span dir="ltr"><<a href="mailto:neha.kothari@db.com">neha.kothari@db.com</a>></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 "TimeBasedRollingPolicy" 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:'Arial',sans-serif;font-size:8pt;color:#000000">---</span><br>
<span style="font-family:'Courier New',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>