[
https://issues.apache.org/jira/browse/LOG4J2-3315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Kamlesh Silag resolved LOG4J2-3315.
-----------------------------------
Resolution: Not A Problem
> %X[key] is not working with bridge api ( Log4j 1.x bridge 2.15.0)
> -----------------------------------------------------------------
>
> Key: LOG4J2-3315
> URL: https://issues.apache.org/jira/browse/LOG4J2-3315
> Project: Log4j 2
> Issue Type: Question
> Components: Configuration
> Affects Versions: 2.15.0
> Reporter: Kamlesh Silag
> Priority: Minor
>
> Hi, I am trying to migrate one of the app from 1.x to 2.15.0. We were using
> MDC for lookups and as per bridge api, we can still use MDC for lookups.
> In Code, we use
>
> {code:java}
> MDC.put("PID", someFunction());{code}
>
> FYI, _MDC.get("PID)_ gives correct lookup information
> Configuration File-
>
> {code:java}
> appender.rolling.layout.type = PatternLayout
> appender.rolling.layout.pattern = %d{dd MMM yyyy HH:mm:ss,SSS} %-5p [%t]
> [%X{PID}] %c - %m%n{code}
> h2. *But, %X\{PID} is giving blank.*
>
> Dependencies we are using-
> # log4j-1.2-api-2.15.0.jar
> # log4j-api-2.15.0.jar
> # log4j-core-2.15.0.jar
> # log4j-jcl-2.15.0.jar
> # commons-logging-1.1.1.jar
>
>
>
>
--
This message was sent by Atlassian Jira
(v8.20.1#820001)