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

LOG4J_CONFIGURATION_FILE environment variable has no effect

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.11.2
    • Fix Version/s: None
    • Component/s: Configurators
    • Labels:
      None

      Description

      According to the docs the environment variables should have highest priority but when using the `LOG4J_CONFIGURATION_FILE` env var it shows no effect at all.
      I tried using relative and absolute path.

      In the debug output it only shows my information about the configuration file I specified via system property.
      System property: log4j2-dev.xml
      Env var: log4j2-prod.xml

      football-trading-service_1 | app[ERROR] TRACE StatusLogger Trying to find [log4j2-dev.xml] using context class loader jdk.internal.loader.ClassLoaders$AppClassLoader@8bcc55f. football-trading-service_1 | app[ERROR] DEBUG StatusLogger Not in a ServletContext environment, thus not loading WebLookup plugin. football-trading-service_1 | app[ERROR] DEBUG StatusLogger Closing BufferedInputStream java.io.BufferedInputStream@7df338c4 football-trading-service_1 | app[ERROR] DEBUG StatusLogger Watching file '/opt/app/target/scala-2.12/classes/log4j2-dev.xml' for lastModified Tue May 07 14:13:47 GMT 2019 (1557238427056) football-trading-service_1 | app[ERROR] DEBUG StatusLogger Apache Log4j Core 2.11.2 initializing configuration XmlConfiguration[location=/opt/app/target/scala-2.12/classes/log4j2-dev.xml]
      

      Looking into the source code it seems this feature is not supported anymore, so either the docs or outdated or its a regression bug.

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              leozilla@gmail.com David Leonhartsberger
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: