Questions tagged [mdc]

MDC (*mapped diagnostic context*) is a way to attach thread-scoped named identifier that can be added to every log message from that thread.

It is used to provide log messages with information that is unavailable to the scope when log is written.It provides the thread and user context to log messages and hence stamp each log for better tracking.

For example, it can help put Correlation Id to a request’s logs to help filter it out from similar logs at that time (from other quests) and also track it easily when this request hop from service to service by sharing the Correlation Id.

Typical use cases

Useful links

288 questions
0
votes
1 answer

EJB interceptor with logging and nested EJB calls

I'm trying to apply general logging for EJB calls via an interceptor. This logging should log the security principal for a bean. The approach uses MDC and pushes the principal to the MDC and removes it, when the method call is finished. However this…
dweisser
  • 63
  • 1
  • 7
-1
votes
1 answer

Spring-Webflux: Add jaeger traceId to log via MDC

I use Sping-Webflux and want to automatically add jaeger traceId into my @Slf4j log. I have an appender in my logback.xml with %X{traceId} pattern like this %d{yyyy-MM-dd HH:mm:ss} %X{traceId} -2048msg%n Following to this…
Mikhail Geyer
  • 881
  • 2
  • 9
  • 27
-1
votes
1 answer

Spring bom usage error

Previous implementation of MDC used org.springframework spring-webmvc ${spring.version} Now am planning to use
Raghuveer
  • 2,859
  • 7
  • 34
  • 66
1 2 3
19
20