I have a logging mechanism setup with Slf4j and java.util.Logging. I have several threads so I'm unable to get a clear idea from logs since they are mixed. Now I try to use MDC concept to add some more data with the log file so they are clear.
Problem is as in Slf4j though it supports MDC java.util.Logging does not. But it says
If the underlying framework does not offer MDC, for example java.util.logging, then SLF4J will still store MDC data but the information therein will need to be retrieved by custom user code.
I'm trying to find a way to do this custom code. Googling does not help me much. There is a helper class in Slf4j named "BasicMDCAdapter". But I don't know how to use it. I couldn't find a sample code anywhere.
This is also a code to help with this but still doesn't give bit of description.
I appreciate a help from some one here.
Thank you.
<dependency><br/> <groupId>ch.qos.logback</groupId><br/> <artifactId>logback-classic</artifactId><br/> <version>0.9.30</version><br/> </dependency><br/> <dependency><br/> <groupId>ch.qos.logback</groupId><br/> <artifactId>logback-core</artifactId><br/> <version>0.9.30</version><br/> </dependency>
<br/> – Convex