gpt4 book ai didi

java - ThreadContext.put() 和 MDC.Put() 有什么区别?

转载 作者:行者123 更新时间:2023-12-01 19:31:42 31 4
gpt4 key购买 nike

我只是想知道threadContext.put和MDC.put之间的区别。因为,我相信两者都在做相同的操作。

最佳答案

Log4j 2 continues with the idea of the MDC and the NDC but merges them into a single Thread Context. The Thread Context Map is the equivalent of the MDC and the Thread Context Stack is the equivalent of the NDC. Although these are frequently used for purposes other than diagnosing problems, they are still frequently referred to as the MDC and NDC in Log4j 2 since they are already well known by those acronyms.

https://logging.apache.org/log4j/2.x/manual/thread-context.html

关于java - ThreadContext.put() 和 MDC.Put() 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59540355/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com