How to trace distributed logs using Spring Cloud Sleuth?

·

1 min read

Good logging can save you time and money.

With the adoption of microservices , one major issue we find in debugging issues in production is to trace logs for a particular work flow.

Logs are not printed in sequence in a live environment and this makes it difficult to track.

I found out a solution using MDC (Mapped Diagnostic Context) pattern provided by major logging frameworks like slf4j and blogged about it here :

How to trace logs across distributed applications/microservices in Spring Boot

A friend later commented that Spring Cloud Sleuth does all the hard work using MDC by itself.

So I researched on that and found it quite useful.

Here is a post on that:

How to trace logs using Spring Cloud Sleuth