[logback-dev] [JIRA] Created: (LBCORE-86) Simultaneous support of %d and %i

Neil Lott (JIRA) noreply-jira at qos.ch
Wed Feb 4 21:18:47 CET 2009

Simultaneous support of %d and %i

                 Key: LBCORE-86
                 URL: http://jira.qos.ch/browse/LBCORE-86
             Project: logback-core
          Issue Type: Bug
          Components: Appender
    Affects Versions: 0.9.14
            Reporter: Neil Lott
            Assignee: Logback dev list

Hello Neil,

FileNamePattern does not support the %d when used within FixedWindowRollingPolicy. Only %i is supported. It's a currentlimitation of the code.

I suggest that you enter a jira issue requesting simultaneous support for %d and %i. Referencing or copying this thread would set a context for the problem which would be helpful.


Neil Lott wrote:
I'm using a FileNamePattern with a FixedWindowPolicy:
Here's my appender:
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
       <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
           <FileNamePattern>/usr/local/neil/logs/MSAServer.%i.%d{yyyyMMdd-HHmmss}.gz</FileNamePattern>             <MinIndex>1</MinIndex>
       <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
       <layout class="ch.qos.logback.classic.PatternLayout">
           <Pattern>%d{ISO8601} %-5level [%thread] \(%logger{0}.%M:%L\\) - %msg%n</Pattern>
Here's the exception when the file rolls -- I had to alter the rollover method of FixedWindowPolicy in order to catch throwable to see what was going on:
java.lang.IllegalArgumentException: Cannot convert 3 of typejava.lang.Integer
   at ch.qos.logback.core.rolling.helper.DateTokenConverter.convert(DateTokenConverter.java:60) 

Is this an intentional restriction to make the file name pattern have %i first and then %d?

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the logback-dev mailing list