On Tue, Nov 27, 2012 at 3:45 PM, RobOaks <span dir="ltr"><<a href="mailto:roboaks@comcast.net" target="_blank">roboaks@comcast.net</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
In addition to the problems I reported in my previous post (<br>
<a href="http://old.nabble.com/Config-file-failures-unexplained-in-list-or-JIRA-td34713039.html#a34713039" target="_blank">http://old.nabble.com/Config-file-failures-unexplained-in-list-or-JIRA-td34713039.html#a34713039</a><br>


<a href="http://old.nabble.com/Config-file-failures-unexplained-in-list-or-JIRA-td34713039.html#a34713039" target="_blank">http://old.nabble.com/Config-file-failures-unexplained-in-list-or-JIRA-td34713039.html#a34713039</a><br>


) , I have found that, for the RollingFileAppender,<br>
<rollingPolicy>/<fileNamePattern> does not work if you also have<br>
<appender>/<file>. Here is the relevant section of my config file:<br>
<br>
<appender name="file"<br>
class="ch.qos.logback.core.rolling.RollingFileAppender"><br>
                <file>Idcp.log</file><br>
                <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"><br>
                        <fileNamePattern>%d{yyyy-MM-dd_HH-mm}_Idcp.log</fileNamePattern><br>
                        <maxHistory>3</maxHistory><br>
                </rollingPolicy><br>
                <encoder><br>
                        <pattern>%-5level %logger{}.%method - %msg%n </pattern><br>
                </encoder><br>
</appender><br>
<br>
With this configuration, all output goes to Idcp.log indefinitely, in spite<br>
of the fact that it should be creating an archive file every minute. As soon<br>
as I remove <file>Idcp.log</file>, active output is logged to a file of the<br>
form yyyy-MM-dd_HH-mm_Idcp.log and a new file is created every minute.<br>
<br>
But, even in the latter case, when archive files are being properly created,<br>
<maxHistory> is ignored and archive files are created ad infinitum.<br>
<br>
Is this a particularly buggy release of Logback? I’m really hoping it’s just<br>
me.<br><br></blockquote><div><br></div><div>It might be just you. ;)</div><div><br></div><div>I used your configuration (from the original post) and modified <fileNamePattern> to match your minute-rollover pattern. The file correctly rolls over every minute for a maximum of 3 times, and the rollover files are archived with the correct filename pattern that you specified. Note the debug output at every minute in [1]. I log a message every second for 4 minutes (plus some padding to verify one complete rollover period beyond the max), and logback correctly archives only 3 files.</div>

<div><br></div><div>[1] <a href="http://pastebin.com/6cr6NJSb">http://pastebin.com/6cr6NJSb</a></div></div><br>