[logback-user] Problems with MDC's inheritance

Hontvári József Levente hontvari at flyordie.com
Tue May 31 01:24:19 CEST 2011


On the other hand it is quite handy for non-pooled threads. The MDC may 
contain information which is complex to create and unrelated to the code 
creating the threads. I did not know about inheritance a few months ago, 
so I was prepared to make a mess by passing unrelated information deep 
in a call chain. It was quite a nice surprise that MDC data 
automagically appeared in the log files because of the inheritance.

On 2011.05.31. 0:47, Matthias Treydte wrote:
> Hello,
>
>> False data is worse than no data, so it would be nice to avoid this. Is
> I've been bitten by this as well and agree that inheritance as the
> default is rather dangerous, especially because using thread pools is
> considered good practice and thus quite common.
>
> Regards,
> -Matthias
>



More information about the Logback-user mailing list