You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Dave Hawkins (Jira)" <ji...@apache.org> on 2022/06/20 17:28:00 UTC

[jira] [Updated] (LOG4J2-3541) ThreadContextDataInjector Uses Incorrect Providers Under Tomcat

     [ https://issues.apache.org/jira/browse/LOG4J2-3541?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dave Hawkins updated LOG4J2-3541:
---------------------------------
    Component/s: Core

> ThreadContextDataInjector Uses Incorrect Providers Under Tomcat
> ---------------------------------------------------------------
>
>                 Key: LOG4J2-3541
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3541
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Core, Web/Servlet
>    Affects Versions: 2.17.1
>         Environment: Tomcat 9.0.58 with the following jars in ${CATALINA_HOME}/lib:
> log4j-api-2.17.1.jar
> log4j-core-2.17.1.jar
> log4j-jul-2.17.1.jar
> JUL LogManager is org.apache.logging.log4j.jul.LogManager
>            Reporter: Dave Hawkins
>            Priority: Major
>
> We are using Log4j with tomcat by including it in the boot classpath and using Log4jServletContextListener in the web.xml. We are also using the log4j JUL LogManager. Web application ContextDataProviders are not being loaded correctly.
> I think this is because ThreadContextDataInjector::getServiceProviders is sensitive to the web application classpath, but the class, which is shared between the web applications and tomcat, statically caches the result. The providers list for tomcat is initialized first and is thus incorrectly used for the web applications.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)