Spring cloud sleuth 3.0.1 generate traceid & spanid in logs using logback

Viewed 1476

I am using spring-cloud-starter-sleuth:3.0.1 and spring-cloud-sleuth-zipkin:3.0.1 to generate traceId and spanId in log file. I was able to get those in logs using 2.2.7.RELEASE version. I have tried using logback but not able to have with 3.0.1 version. As per 3.0.1 documentation, they have removed Legacy MDC entries but brave spanId & traceId are there.

Dependency hierarchy: Dependency_hierarchy

traceId & spanId are not generated in log:

Log

I have tried to see this request's tracing on zipkin and able to see it with traceid and spanid:

zipkin

Can anyone help me to get traceid and spanid in log file using logback/log4j?

1 Answers
Related