commit
94969021ca
|
@ -28,7 +28,7 @@ public class SleuthService {
|
|||
public void doSomeWorkNewSpan() throws InterruptedException {
|
||||
logger.info("I'm in the original span");
|
||||
|
||||
Span newSpan = tracer.newTrace().name("newSpan").start();
|
||||
Span newSpan = tracer.nextSpan().name("newSpan").start();
|
||||
try (SpanInScope ws = tracer.withSpanInScope(newSpan.start())) {
|
||||
Thread.sleep(1000L);
|
||||
logger.info("I'm in the new span doing some cool work that needs its own span");
|
||||
|
|
|
@ -1,13 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
|
||||
</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<root level="INFO">
|
||||
<appender-ref ref="STDOUT" />
|
||||
</root>
|
||||
<!-- this is the configuration needed for the Sleuth examples;
|
||||
don't override this with the standard logback config
|
||||
-->
|
||||
|
||||
<configuration>
|
||||
<include resource="org/springframework/boot/logging/logback/base.xml"/>
|
||||
<logger name="feign" level="DEBUG"/>
|
||||
<logger name="org.springframework.cloud.sleuth" level="TRACE"/>
|
||||
<logger name="org.springframework.boot.autoconfigure.logging" level="INFO"/>
|
||||
<logger name="org.springframework.cloud.sleuth.log" level="DEBUG"/>
|
||||
<logger name="org.springframework.cloud.sleuth.trace" level="DEBUG"/>
|
||||
<logger name="org.springframework.cloud.sleuth.instrument.rxjava" level="DEBUG"/>
|
||||
<logger name="org.springframework.cloud.sleuth.instrument.reactor" level="TRACE"/>
|
||||
<root level="INFO">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="FILE"/>
|
||||
</root>
|
||||
</configuration>
|
Loading…
Reference in New Issue