@@ -19,7 +19,8 @@ package sample;
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.context.embedded.EmbeddedServletContainerInitializedEvent;
|
||||
import org.springframework.cloud.sleuth.Span;
|
||||
@@ -38,8 +39,7 @@ import org.springframework.web.client.RestTemplate;
|
||||
public class SampleController implements
|
||||
ApplicationListener<EmbeddedServletContainerInitializedEvent> {
|
||||
|
||||
private static final Logger log = org.slf4j.LoggerFactory
|
||||
.getLogger(SampleController.class);
|
||||
private static final Log log = LogFactory.getLog(SampleController.class);
|
||||
|
||||
@Autowired
|
||||
private RestTemplate restTemplate;
|
||||
@@ -97,7 +97,7 @@ ApplicationListener<EmbeddedServletContainerInitializedEvent> {
|
||||
Span span = this.tracer.startTrace("http:customTraceEndpoint",
|
||||
new AlwaysSampler());
|
||||
int millis = this.random.nextInt(1000);
|
||||
log.info("Sleeping for {} millis", millis);
|
||||
log.info(String.format("Sleeping for [%d] millis", millis));
|
||||
Thread.sleep(millis);
|
||||
this.tracer.addTag("random-sleep-millis", String.valueOf(millis));
|
||||
|
||||
@@ -110,7 +110,7 @@ ApplicationListener<EmbeddedServletContainerInitializedEvent> {
|
||||
@RequestMapping("/start")
|
||||
public String start() throws InterruptedException {
|
||||
int millis = this.random.nextInt(1000);
|
||||
log.info("Sleeping for {} millis", millis);
|
||||
log.info(String.format("Sleeping for [%d] millis", millis));
|
||||
Thread.sleep(millis);
|
||||
this.tracer.addTag("random-sleep-millis", String.valueOf(millis));
|
||||
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
|
||||
package sample;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
@@ -33,8 +34,7 @@ import org.springframework.scheduling.annotation.EnableAsync;
|
||||
@EnableAsync
|
||||
public class SampleZipkinApplication {
|
||||
|
||||
private static final Logger log = org.slf4j.LoggerFactory
|
||||
.getLogger(SampleZipkinApplication.class);
|
||||
private static final Log log = LogFactory.getLog(SampleZipkinApplication.class);
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(SampleZipkinApplication.class, args);
|
||||
@@ -47,7 +47,7 @@ public class SampleZipkinApplication {
|
||||
return new ZipkinSpanReporter() {
|
||||
@Override
|
||||
public void report(zipkin.Span span) {
|
||||
log.info("Reporting span [{}]", span);
|
||||
log.info(String.format("Reporting span [%s]", span));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -17,10 +17,11 @@ package integration;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.slf4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
@@ -76,8 +77,7 @@ public class ZipkinTests extends AbstractIntegrationTest {
|
||||
@Configuration
|
||||
public static class WaitUntilZipkinIsUpConfig {
|
||||
|
||||
private static final Logger log = org.slf4j.LoggerFactory
|
||||
.getLogger(WaitUntilZipkinIsUpConfig.class);
|
||||
private static final Log log = LogFactory.getLog(WaitUntilZipkinIsUpConfig.class);
|
||||
|
||||
@Bean
|
||||
public ZipkinSpanReporter spanCollector(final ZipkinProperties zipkin,
|
||||
|
||||
Reference in New Issue
Block a user