You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Kamlesh Silag (Jira)" <ji...@apache.org> on 2022/01/04 19:13:00 UTC
[jira] [Created] (LOG4J2-3315) %X[key] is not working with bridge api ( Log4j 1.x bridge 2.15.0)
Kamlesh Silag created LOG4J2-3315:
-------------------------------------
Summary: %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
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)