You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Matt Sicker (Jira)" <ji...@apache.org> on 2019/09/21 17:05:00 UTC

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

    [ https://issues.apache.org/jira/browse/LOG4J2-2601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16935093#comment-16935093 ] 

Matt Sicker commented on LOG4J2-2601:
-------------------------------------

This sounds like a regression.

> 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
>            Priority: Minor
>
> 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
(v8.3.4#803005)