On Tue, Nov 27, 2012 at 3:45 PM, RobOaks <roboaks@comcast.net> wrote:
In addition to the problems I reported in my previous post (
http://old.nabble.com/Config-file-failures-unexplained-in-list-or-JIRA-td34713039.html#a34713039
http://old.nabble.com/Config-file-failures-unexplained-in-list-or-JIRA-td34713039.html#a34713039
) , I have found that, for the RollingFileAppender,
<rollingPolicy>/<fileNamePattern> does not work if you also have
<appender>/<file>. Here is the relevant section of my config file:
<appender name="file"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>Idcp.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>%d{yyyy-MM-dd_HH-mm}_Idcp.log</fileNamePattern>
<maxHistory>3</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%-5level %logger{}.%method - %msg%n </pattern>
</encoder>
</appender>
With this configuration, all output goes to Idcp.log indefinitely, in spite
of the fact that it should be creating an archive file every minute. As soon
as I remove <file>Idcp.log</file>, active output is logged to a file of the
form yyyy-MM-dd_HH-mm_Idcp.log and a new file is created every minute.
But, even in the latter case, when archive files are being properly created,
<maxHistory> is ignored and archive files are created ad infinitum.
Is this a particularly buggy release of Logback? I’m really hoping it’s just
me.