You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "David Leonhartsberger (JIRA)" <ji...@apache.org> on 2019/05/07 14:30:00 UTC

[jira] [Created] (LOG4J2-2601) LOG4J_CONFIGURATION_FILE environment variable has no effect

David Leonhartsberger created LOG4J2-2601:
---------------------------------------------

             Summary: LOG4J_CONFIGURATION_FILE environment variable has no effect
                 Key: LOG4J2-2601
                 URL: https://issues.apache.org/jira/browse/LOG4J2-2601
             Project: Log4j 2
          Issue Type: Bug
          Components: Configurators
    Affects Versions: 2.11.2
            Reporter: David Leonhartsberger


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


{code:java}
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]
{code}
Looking into the source code it seems this feature is not supported anymore, so either the docs or outdated or its a regression bug.

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)