Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-3315

%X[key] is not working with bridge api ( Log4j 1.x bridge 2.15.0)

    XMLWordPrintableJSON

Details

    • Question
    • Status: Closed
    • Minor
    • Resolution: Not A Problem
    • 2.15.0
    • None
    • Configuration
    • None

    Description

      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

       

      MDC.put("PID", someFunction());

       

      FYI, MDC.get("PID) gives correct lookup information

      Configuration File-

       

      appender.rolling.layout.type = PatternLayout
      appender.rolling.layout.pattern = %d{dd MMM yyyy HH:mm:ss,SSS} %-5p [%t] [%X{PID}] %c - %m%n

      But, %X{PID} is giving blank. 

       

      Dependencies we are using-

      1. log4j-1.2-api-2.15.0.jar
      2. log4j-api-2.15.0.jar
      3. log4j-core-2.15.0.jar
      4. log4j-jcl-2.15.0.jar
      5. commons-logging-1.1.1.jar

       

       

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            kamleshsilag Kamlesh Silag
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: