我正在使用SpringBoot2上的Spring Cloud Starter Sleuth尝试我的第一个项目,并且遇到了一个问题。让我先分享我的应用程序配置:
var allbtns = document.getElementsByClassName("btn");
for (var i = 0; i < allbtns.length; i++) {
var btn = allbtns[i];
btn.onclick = function() {
if (this.classList.contains('q1Button')) {
var q1btns = document.getElementsByClassName('q1Button')
for (var i = 0; i < q1btns.length; ++i) {
var item = q1btns[i];
item.style.backgroundColor = (item.id == this.id) ? "red" : "";
}
}
if (this.classList.contains('q2Button')) {
var q2btns = document.getElementsByClassName('q2Button')
for (var i = 0; i < q2btns.length; ++i) {
var item = q2btns[i];
item.style.backgroundColor = (item.id == this.id) ? "red" : "";
}
}
}
}
create table CodeLookup
(
txtCode varchar(10) not null
, CodeValue varchar(10) not null
, StateCode char(2) not null
, DateCreated datetime not null
)
insert CodeLookup values
('100A', '567BR', 'OH', getdate())
, ('100A', 'Thing', 'VA', getdate())
, ('100B', '4FJEU', 'OH', getdate())
, ('100B', '54DS', 'VA', getdate())
select *
from CodeLookup
我启动了我的应用程序,但是在点击我的服务时没有看到任何spanIds或Trace id。
这是日志的外观:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.2.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<spring-cloud.version>Finchley.RC2</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
</dependency>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
...
在我的应用配置中,我做错了什么?
答案 0 :(得分:1)
为什么你认为有什么不对?收到请求后你有没有记录任何东西?我想我们在项目的自述文件中写到这一点,如果你刚启动应用程序,什么都不会发生。尝试在控制器中记录某事并发送请求以查看日志中的ID