On 22/01/2010 11:20 AM, Gunnar Wagenknecht wrote:
Hi,

I noticed that the BasicMDCAdapter uses a regular InheritableThreadLocal
while the LogbackMDCAdapter uses a custom "CopyOnInheritThreadLocal".
The JavaDoc implies that they should be similar. Any reasons why the
difference in implementation was chosen (perhaps performance, memory)?

Having children thread inherit a copy of the mdc map seems like the correct thing to do. I don't remember why BasicMDCAdapter does not do the same.

Also BasicMDCAdapter seems to require Java 5 although it's part of the
SLF4J API library. It calls ThreadLocal#remove() directly (without
reflection) which does not exists in JDK<= 1.4.

You are right. Interestingly enough, no one has complained about this omission. Either no one is using org.slf4j.MDC under JDK 1.4 or those who run into problems do not care enough to complain.

-Gunnar


_______________________________________________
slf4j-dev mailing list
[email protected]
http://qos.ch/mailman/listinfo/slf4j-dev

Reply via email to