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

RollingFileAppenderBuilder in log4j1 bridge does not create the appender as in log4j1

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.17.1
    • 2.17.2
    • Configuration
    • None

    Description

      https://github.com/apache/logging-log4j2/blob/release-2.x/log4j-1.2-api/src/main/java/org/apache/log4j/builders/appender/RollingFileAppenderBuilder.java

      creates the appender with a date filePattern.

      We are using a configuration like this

      log4j.appender.file=org.apache.log4j.RollingFileAppender
      log4j.appender.file.layout=org.apache.log4j.PatternLayout
      log4j.appender.file.layout.ConversionPattern=%d{DEFAULT} [%t] %-5p %-33c{1} %x %m%n
      log4j.appender.file.File=foobar.log
      log4j.appender.file.MaxFileSize=200000KB
      log4j.appender.file.MaxBackupIndex=100
      

      With log4j 1.2.17 this created rolled files
      foobar.log.1
      foobar.log.2
      etc

      With log4j2 and the bridge we get
      foobar.log2021-12-19

      We could live with the date pattern but it should produce
      foobar.log.2021-12-19

      But since the rollover policy is still size-based what happens if the file is rolled twice a day?

      Attachments

        Activity

          People

            Unassigned Unassigned
            achim.abeling Achim
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: