Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-1205

RollingFileAppender logs first log to old dated file

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.2
    • None
    • Appenders
    • None
    • The issue can be recreated in both Windows 7 and AIX.

    Description

      When empty log file (0 byte) with old time stamp exists, RollingFileAppender logs first log to the rolled file.

      For example, when given the following configuration,

      <RollingFile
          name="RollingFile"
          fileName="rolling.log"
          filePattern="rolling.log.%d{yyyyMMdd}">
              <PatternLayout pattern="%d{yyyy-MM-dd} %msg%n" />
      </RollingFile>
      

      and empty rolling.log file exists with time stamp 2015-11-01, after logging two log records (say today) result as followings.

      rolling.log.20151101

      2015-11-25 FIRST LOG

      rolling.log

      2015-11-25 SECOND LOG

      Both record should be logged in rolling.log file and no dated file created.

      Attachments

        Activity

          People

            Unassigned Unassigned
            Tai Tash Taisuke Tashiro
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: