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

RollingFileManager create wrong file name with TimeBasedTriggeringPolicy

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Bug
    • 2.11.2
    • None
    • Appenders
    • windows 7 x64

      java 11 openjdk x64

    Description

      because of the app.log file is never delete, app.log file create time never change.

      first day all log write in app.log

      second day app.log content copy to app-first day.log, second day log write in app.log

      third day app.log content copy to app-first day.log, third day log write in app.log

      debug the code AbstractRolloverStrategy#getEligibleFiles:91 call PatternProcessor#formatFileName:257 create file use prevFileTime

      prevFileTime is set at RollingFileManager#initialFileTime:683 use file creationTime.

      I think third day app.log content should copy to app-second day.log. the code should delete app.log file then create file or use app.log last modify time

      Attachments

        1. log4j2.xml
          2 kB
          finalmachine

        Activity

          People

            Unassigned Unassigned
            finalmachine finalmachine
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified