"If debugging is the process of removing software bugs, then programming must be the process of putting them in." - Edsger Dijkstra0x00 大纲
“如果调试是消除软件Bug的过程,那么编程就是产出Bug的过程。” —— 艾兹格·迪杰斯特拉
This class hides and serves as a substitute for the underlying logging system's MDC implementation.目前为止只有logback和log4j(log4j2)提供了较为完备的实现,其余日志框架下会使用SLF4J内部实现的BasicMDCAdapter或者NOPMDCAdapter.
If the underlying logging system offers MDC functionality, then SLF4J's MDC, i.e. this class, will delegate to the underlying system's MDC. Note that at this time, only two logging systems, namely log4j and logback, offer MDC functionality. For java.util.logging which does not support MDC, BasicMDCAdapter will be used. For other systems, i.e. slf4j-simple and slf4j-nop, NOPMDCAdapter will be used.
Thus, as a SLF4J user, you can take advantage of MDC in the presence of log4j, logback, or java.util.logging, but without forcing these systems as dependencies upon your users.
欢迎光临 IT评测·应用市场-qidao123.com (https://dis.qidao123.com/) | Powered by Discuz! X3.4 |