[logback-user] Problem with fileNamePattern for daily rollover

Christophe Roudet croudet at activia.net
Wed Dec 14 15:44:42 CET 2011


Hello,

I'd like to set up a daily rollover:

<appender name="monitoringAppender" 
class="ch.qos.logback.core.rolling.RollingFileAppender">
<append>true</append>
<file>log/monitoring.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- daily rollover -->
<fileNamePattern>log/monitoring-%d{EE}.log</fileNamePattern>
<maxHistory>7</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} - %msg%n</pattern>
</encoder>
</appender>

but when I set up the fileNamePattern with %d{EE} archives are not created.
Using the default pattern %d{yyyy-MM-dd} works fine.

Am I doing something wrong?

Thanks,

Christophe


More information about the Logback-user mailing list