[logback-user] Is MDC thread safe?

Odd Man valodzka at gmail.com
Sun Aug 28 16:39:25 CEST 2011


I've read that logback is thread safe, but I got exception using MDC.
Is it bug or MDC access should be syncronized?

java.util.ConcurrentModificationException: null
	at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793) ~[na:1.6.0_26]
	at java.util.HashMap$EntryIterator.next(HashMap.java:834) ~[na:1.6.0_26]
	at java.util.HashMap$EntryIterator.next(HashMap.java:832) ~[na:1.6.0_26]
	at java.util.HashMap.putAll(HashMap.java:523) ~[na:1.6.0_26]
	at ch.qos.logback.classic.util.LogbackMDCAdapter.duplicateAndInsertNewMap(LogbackMDCAdapter.java:69)
~[logback-classic-0.9.29.jar:na]
	at ch.qos.logback.classic.util.LogbackMDCAdapter.put(LogbackMDCAdapter.java:95)
~[logback-classic-0.9.29.jar:na]
	at org.slf4j.MDC.put(MDC.java:112) ~[slf4j-api-1.6.1.jar:1.6.1]


More information about the Logback-user mailing list