Details
-
Bug
-
Resolution: Not a bug
-
Major
-
None
-
1.4.8
-
None
Description
Have pushed a repo with single test case demonstrating the issue:
https://bitbucket.org/tomhaines/logback-npe-148-mdc/src/master/
Starting in 1.4.8, the following NPE occurs:
Cannot invoke "ch.qos.logback.classic.LoggerContext.getMDCAdapter()" because "this.loggerContext" is null java.lang.NullPointerException: Cannot invoke "ch.qos.logback.classic.LoggerContext.getMDCAdapter()" because "this.loggerContext" is null at ch.qos.logback.classic.spi.LoggingEvent.getMDCPropertyMap(LoggingEvent.java:407) at com.logback.example.StackJsonLayout.createContextNode(StackJsonLayout.java:74) at com.logback.example.StackJsonLayout.doLayout(StackJsonLayout.java:60) at com.logback.example.StackJsonLayoutTest.testBasic(StackJsonLayoutTest.java:22)
To replicate, run
./gradlew test
If you change back to logback 1.4.7 via gradle dependencies, the test passes.