Home > Net >  Spring Boot Sleuth Not Printing Trace and Span Logs
Spring Boot Sleuth Not Printing Trace and Span Logs

Time:10-02

In my spring 2.5.5 project, I am trying to configure sleuth-zipkin with the below dependencies.

         <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-sleuth-zipkin</artifactId>
            <version>3.0.0</version>
        </dependency>

The spring cloud version is

<spring-cloud.version>2020.0.4</spring-cloud.version>

Now for logging - I am using Sl4J and logged in the statements using INFO.

When I run the application I can see my INFO level logs but I can't see the trace and spans ids printed nor can I see them in my Zipkin's server.

Any guesses what is going wrong here?

CodePudding user response:

Please do as the docs says:

  1. Do not specify spring clod dependencies (<version>3.0.0</version>), the BOM will define them
  2. Use spring-cloud-starter-sleuth which should add Sleuth support with log correlation and spring-cloud-sleuth-zipkin if you also want to send spans to Zipkin

Here's an example from the docs: https://docs.spring.io/spring-cloud-sleuth/docs/current/reference/htmlsingle/#how-to-set-up-sleuth-with-brave-zipkin-http

  • Related