
30 May
2011
30 May
'11
11:24 p.m.
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