You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2022/01/04 20:18:00 UTC

[jira] [Commented] (LOG4J2-3315) %X[key] is not working with bridge api ( Log4j 1.x bridge 2.15.0)

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

Gary D. Gregory commented on LOG4J2-3315:
-----------------------------------------

Hi [~kamleshsilag] 

You should use 2.17.1, not 2.15.0, for the safest setup.

Would you confirm whether this still happens in 2.17.1?

> %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)