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

Properties are not resolved with Log4J1 configuration

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.13.3
    • 2.15.0
    • Log4j 1.2 bridge
    • None

    Description

      When using the log4j 1.2 emulation, the resolution of variables in the log4j.properties does not work.

      ...
      maxbackupindex=20
      log4j.appender.RFA=org.apache.log4j.RollingFileAppender
      log4j.appender.RFA.MaxBackupIndex=${maxbackupindex}
      ...
      

       

      I've also created a sample project which shows the problem:

      https://github.com/thackel/log4j2-legacy-test

      The log4j1 initialization (using system property) works and the property file is read automatically from the classpath, just the variable substitution does not work.

      Whats interesting that there is an existing Testcase in Log4J, which shows that it somehow works:

      Log4j1ConfigurationFactoryTest.java with its log4j.properties.

      Attachments

        Activity

          People

            rgoers Ralph Goers
            thackel Thomas Hackel
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: