带有弹簧靴 2 的侦探 2 不会在日志中添加跟踪 id



我最近开始探索sping boot 2。我用于日志记录目的。对于分布式日志记录跟踪,我想使用 sping 引导侦探启动器。但是在pom中具有以下依赖性.xml如果没有zipkin集成,它就不会在日志中添加traceid。还在 application.properties 文件中添加了 spring.application.name 属性。我在这里错过了什么吗?

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.3.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
<version>2.0.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
<version>2.0.0.RELEASE</version>
</dependency>

您使用的是什么日志记录框架?我在我的项目中使用了log4j2。当我删除 log4j2 并将其留给弹簧云侦探的默认日志记录时,它开始工作。

最新更新