[logback-dev] [Bug 82] New: TimeBasedRollingPolicy can create files with bad dates

bugzilla-daemon at pixie.qos.ch bugzilla-daemon at pixie.qos.ch
Thu Jun 21 19:59:09 CEST 2007


http://bugzilla.qos.ch/show_bug.cgi?id=82

           Summary: TimeBasedRollingPolicy can create files with bad dates
           Product: logback-core
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P1
         Component: Rolling
        AssignedTo: logback-dev at qos.ch
        ReportedBy: dek94 at gravitext.com


Version: logback 0.9.7
JDK 1.6.0

Configuration:

  <appender name="FILE"
class="ch.qos.logback.core.rolling.RollingFileAppender">
    <File>./logs/error.log</File>
    <Append>true</Append>
    <Encoding>UTF-8</Encoding>
    <BufferedIO>false</BufferedIO>
    <ImmediateFlush>true</ImmediateFlush>

    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <FileNamePattern>./logs/error.%d{yyyy_MM_dd-HH-mm}</FileNamePattern>
    </rollingPolicy>

    <layout class="ch.qos.logback.classic.PatternLayout">
      <Pattern>%date [%thread] %-5level %logger{35} - %msg%n</Pattern>
    </layout>
  </appender> 

Using one-minute rolling policy to reproduce the problem easily, but same
occurs with one day logs.  Here is a listing of files created:

-rw-rw-r-- 1 dkellum dkellum  306 Jun 21 10:40 error.1969_12_31-16-00
-rw-rw-r-- 1 dkellum dkellum 2.5K Jun 21 10:38 error.2007_06_21-10-38
-rw-rw-r-- 1 dkellum dkellum  306 Jun 21 10:40 error.log

Same problem with 1-day rolling:

-rw-rw-r-- 1 dkellum dkellum  311 Jun 21 10:17 error.1969-12-31
-rw-rw-r-- 1 dkellum dkellum 2.5K Jun 20 15:25 error.2007-06-20
-rw-rw-r-- 1 dkellum dkellum  251 Jun 21 10:17 error.log


-- 
Configure bugmail: http://bugzilla.qos.ch/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the logback-dev mailing list