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

MDC in Log4j1 bridge is not interoperable with Log4j2 or other brigdes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.17.2
    • None
    • Core
    • None

    Description

      When invoking org.apache.log4j.MDC.get(key) on library {{{}org.apache.logging.log4j:log4j-1.2-api
      {}}}you don'thave access to Thread-Context variables that where set with

      • org.apache.logging.log4j.ThreadContext.put(key, value) from org.apache.logging.log4j:log4j-core
      • org.slf4j.MDC.put(key, value) from org.apache.logging.log4j:log4j-slf4j-impl
      • probably pother brigdes too

      See JUnit tests in ThreadContextConsistencyTest.java from a simple maven project with pom.xml

      Attachments

        1. ThreadContextConsistencyTest.java
          2 kB
          Horst Gernhardt
        2. pom.xml
          1 kB
          Horst Gernhardt

        Activity

          People

            Unassigned Unassigned
            hotte Horst Gernhardt
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: