Allow sample to enable log collector with a property.
Property is sleuth.sample.logging.collector.enabled=true
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
package org.springframework.cloud.sleuth.sample;
|
||||
|
||||
import com.github.kristofa.brave.LoggingSpanCollectorImpl;
|
||||
import com.github.kristofa.brave.SpanCollector;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.cloud.sleuth.Sampler;
|
||||
import org.springframework.cloud.sleuth.sampler.AlwaysSampler;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -33,9 +36,10 @@ public class SampleApplication {
|
||||
}
|
||||
|
||||
// Use this for debugging (or if there is no Zipkin collector running on port 9410)
|
||||
// @Bean
|
||||
// public SpanCollector spanCollector() {
|
||||
// return new LoggingSpanCollectorImpl();
|
||||
// }
|
||||
@Bean
|
||||
@ConditionalOnProperty("sleuth.sample.logging.collector.enabled")
|
||||
public SpanCollector spanCollector() {
|
||||
return new LoggingSpanCollectorImpl();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user