[logback-user] log rollover using %d multiple times in file name pattern?

Thomas Corte Thomas.Corte at knipp.de
Tue Dec 20 15:09:20 CET 2011


I'm trying to configure a log rollover with logs being *rolled daily* 
and put into a directory named "yyyy-MM", i.e. one folder for each 
*month* containing that month's logs. I'm using the following appender 

   <appender name="FILE" 

       <!-- rollover every minute -->

       <pattern>%d{"yyyy-MM-dd HH:mm:ss,SSS"} [%thread] %-5level 
%logger{36} - %msg%n%xEx</pattern>

However, it seems as if the current logback implementation merely 
considers the first %d specification, which leads to a log rotation only 
once per month instead of the desired once per day frequency.

I figure this is because via %d, the log rotation frequency and the file 
name pattern are somewhat tied together and seemingly can't be specified 

Is there any way to achieve what I'm trying to do without writing custom 

Best regards,


Thomas Corte
Thomas.Corte at knipp.de

More information about the Logback-user mailing list