Uploaded image for project: 'SLF4J'
  1. SLF4J
  2. SLF4J-423

1.8.0-beta0 bug in log4j MDC handling

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major Major
    • None
    • 1.8.0-beta0
    • Unspecified
    • None
    • Java 9

    • normal

    Description

      When running with log4j 2.10.0, and using the slf4j-log4j12-1.8.0-beta0 release, the follow error is received:

      java.lang.NoSuchFieldException: mdc
       at java.base/java.lang.Class.getDeclaredField(Unknown Source)
       at org.apache.log4j.MDCFriend.fixForJava9(MDCFriend.java:13)
       at org.slf4j.log4j12.Log4jMDCAdapter.<clinit>(Log4jMDCAdapter.java:38)
       at org.slf4j.log4j12.Log4j12ServiceProvider.initialize(Log4j12ServiceProvider.java:37)
       at org.slf4j.LoggerFactory.bind(LoggerFactory.java:153)
       at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:141)
       at org.slf4j.LoggerFactory.getProvider(LoggerFactory.java:413)
       at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:405)
       at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:354)
       at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:380)

      The MDC class in log4j-1.2-api-2.10.0.jar no longer contains a field named "mdc".  (This is on Java 9).

       

      Attachments

        Activity

          People

            slf4j-dev SLF4J developers list
            brettw Brett Wooldridge
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: