ofpay / logback-mdc-ttl

logback扩展,集成transmittable-thread-local支持跨线程池的mdc跟踪
Apache License 2.0
154 stars 38 forks source link

logback1.2.3似乎不支持MDC线程可继承了 #2

Closed Qsimple closed 7 years ago

Qsimple commented 7 years ago

logback从1.1.5版本之后,新的commit将MDC内部维护的InheritThreadLocal修改成了ThreadLocal,MDC不支持线程继承了。

Child threads no longer inherit MDC values. In previous versions of logback as well as log4j 1.x, MDC values were inherited by child threads. Several users have argued convincingly that MDC inheritance by child threads was unhelpful and even dangerous. This change fixes LOGBACK-422 and LOGBACK-624 https://logback.qos.ch/news.html

wuwen5 commented 7 years ago

不影响, 你可以看下 #1 之前我的回复中也有提到1.1.5版本的问题。 logback-mdc-ttl本身就是使用TransmittableThreadLocal完全替换了原来的实现。