Details
-
Bug
-
Resolution: Fixed
-
Minor
-
2.0.0
-
None
-
None
Description
The Reload4jMDCAdapter has been updated in 2.0 and the setContextMap method has a small but crucial logic bug in the case where the existing MDC is null.
Compare Reload4jMDCAdapter from 1.7.36 and the Reload4jMDCAdapter from the current master branch.
The former iterates over the context map and adds entries to the MDC like this:
org.apache.log4j.MDC.put((String) mapEntry.getKey(), mapEntry.getValue());
The latter also iterates over the context map but adds entries like this:
org.apache.log4j.MDC.put(mapEntry.getKey(), mapEntry);
This winds up setting an MDC where the keys are mapped to the map entry objects of the original context map instead of the values from that map.
Attachments
Issue Links
- links to