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

Property log4j.configurationFile incorrectly documented, log4j.configuration missing

    XMLWordPrintableJSON

Details

    • Documentation
    • Status: Resolved
    • Minor
    • Resolution: Cannot Reproduce
    • 2.16.0
    • None
    • Configuration
    • None

    Description

      According to [1], Log4j looks for the system property log4j2.configurationFile. According to the sources of log4j-core-2.16.0 (ConfigurationFactory.java), the searched property is log4j.configurationFile. The other property does not seem to have any effect in recent versions.

      [1] https://logging.apache.org/log4j/2.x/manual/configuration.html

      Additionally, since 2.14.0 it looks for the property log4j.configuration (no "File"), which was also the property used by Log4j 1.x. As a consequence, logging stopped working in some of our systems after upgrading to 2.16.0 due to Log4Shell. Those systems are using both 1.x and 2.x so they have the property log4j.configuration set but not log4j.configurationFile, because we relied on the previous behaviour that if log4j.configurationFile is not set it looks in the classpath. I had to use a debugger to find out why it stopped working.

      It would be nice if that second property would also be mentioned in [1].

      Attachments

        Activity

          People

            Unassigned Unassigned
            lordjaxom Sascha Volkenandt
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: