<div dir="ltr"><div><span style="color:rgb(36,39,41);font-family:arial,'helvetica neue',helvetica,sans-serif;font-size:15px">Hi All,</span></div><span style="color:rgb(36,39,41);font-family:arial,'helvetica neue',helvetica,sans-serif;font-size:15px"><div><span style="color:rgb(36,39,41);font-family:arial,'helvetica neue',helvetica,sans-serif;font-size:15px"><br></span></div>We are using SizeAndTimeBasedRollingPolicy/SizeAndTimeBasedFNATP in our product (logback 1.1.3). Here is snip from the logback configuration file :</span><br><div><span style="color:rgb(36,39,41);font-family:arial,'helvetica neue',helvetica,sans-serif;font-size:15px"><br></span></div><div><div><font size="1">    <appender name="SERVER_FILE"</font></div><div><font size="1">        class="ch.qos.logback.core.rolling.RollingFileAppender"></font></div><div><font size="1">        <file>${MY_LOGS}/myabc.log</file></font></div><div><font size="1">        <append>true</append></font></div><div><font size="1">        <!-- </font></div><div><font size="1">            Roll log file on both time (per day) and size (250mb). Gzip on roll.</font></div><div><font size="1">        --></font></div><div><font size="1">        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"></font></div><div><font size="1">            <!-- location and name of rolled log files --></font></div><div><font size="1">            <fileNamePattern>${MY_LOGS}/myabc-%d{yyyy-MM-dd}.<b>%i.gz</b></fileNamePattern></font></div><div><font size="1">            <!-- keep 30 days worth of history --></font></div><div><font size="1">            <maxHistory>30</maxHistory></font></div><div><font size="1">            <timeBasedFileNamingAndTriggeringPolicy</font></div><div><font size="1">                class="ch.qos.logback.core.rolling.<b>SizeAndTimeBasedFNATP"></b></font></div><div><font size="1">                <!-- whenever the file size reaches 250MB, roll it --></font></div><div><font size="1">                <maxFileSize>250MB</maxFileSize></font></div><div><font size="1">            </timeBasedFileNamingAndTriggeringPolicy></font></div><div><font size="1">        </rollingPolicy></font></div><div><font size="1">        <encoder></font></div><div><font size="1">            <pattern>%d{yyyy-MM-dd'T'HH:mm:ss.SSS} [%thread] %-5level %logger{24} [%C{1}.%M]</pattern></font></div><div><font size="1">        </encoder></font></div><div><font size="1">    </appender></font></div></div><div><br></div><div><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,'helvetica neue',helvetica,sans-serif">The log files generated have the following names : myabc-2016-11-21.0.gz, myabc-2016-11-21.1.gz, myabc-2016-11-21.2.gz etc. </p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,'helvetica neue',helvetica,sans-serif">The problem is if a log file has extension (%i) more than 3 digits, it is not being deleted after 30 days (maxHistory). For example, myabc-2016-11-21.0.gz gets deleted after 30 days, but myabc-2016-11-21.<strong style="margin:0px;padding:0px;border:0px">1000</strong>.gz is <b>NOT</b> getting deleted.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,'helvetica neue',helvetica,sans-serif">Is there any other appender/configuration which I need to add to the logback configuration file to make sure files with more than 3 digit extension also gets deleted or is it a bug in logback?</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,'helvetica neue',helvetica,sans-serif">I know that total number of log files generated can be controlled by setting the property "totalSizeCap" and that way I can avoid generating more than 999 files per day. But that is not the answer I am looking for. Also, I have tried with logback 1.1.7, but that did not help.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,'helvetica neue',helvetica,sans-serif">Since for us this issue has been raised by the customer, for the sake of urgency, I have posted this question in <a href="http://stackoverflow.com/questions/40144806/logback-sizeandtimebasedrollingpolicy-not-deleting-files-with-4-digit-i">stack overflow</a> as well. To avoid duplicity, I can delete the other thread if needed.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,'helvetica neue',helvetica,sans-serif">Your help will be highly appreciated.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,'helvetica neue',helvetica,sans-serif">Thanks,</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,'helvetica neue',helvetica,sans-serif">Arnab</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,'helvetica neue',helvetica,sans-serif"><br></p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,'helvetica neue',helvetica,sans-serif"><br></p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,'helvetica neue',helvetica,sans-serif"><br></p></div><div><br></div></div>