diff --git a/middlewares/tracing/jaeger/jaeger.go b/middlewares/tracing/jaeger/jaeger.go index 6a130f18dd..e4840b7a73 100644 --- a/middlewares/tracing/jaeger/jaeger.go +++ b/middlewares/tracing/jaeger/jaeger.go @@ -6,7 +6,6 @@ import ( "github.com/containous/traefik/log" "github.com/opentracing/opentracing-go" jaegercfg "github.com/uber/jaeger-client-go/config" - jaegerlog "github.com/uber/jaeger-client-go/log" jaegermet "github.com/uber/jaeger-lib/metrics" ) @@ -35,13 +34,12 @@ func (c *Config) Setup(componentName string) (opentracing.Tracer, io.Closer, err }, } - jLogger := jaegerlog.StdLogger jMetricsFactory := jaegermet.NullFactory // Initialize tracer with a logger and a metrics factory closer, err := jcfg.InitGlobalTracer( componentName, - jaegercfg.Logger(jLogger), + jaegercfg.Logger(&jaegerLogger{}), jaegercfg.Metrics(jMetricsFactory), ) if err != nil { diff --git a/middlewares/tracing/jaeger/logger.go b/middlewares/tracing/jaeger/logger.go new file mode 100644 index 0000000000..a1b20ddb42 --- /dev/null +++ b/middlewares/tracing/jaeger/logger.go @@ -0,0 +1,15 @@ +package jaeger + +import "github.com/containous/traefik/log" + +// jaegerLogger is an implementation of the Logger interface that delegates to traefik log +type jaegerLogger struct{} + +func (l *jaegerLogger) Error(msg string) { + log.Errorf("Tracing jaeger error: %s", msg) +} + +// Infof logs a message at debug priority +func (l *jaegerLogger) Infof(msg string, args ...interface{}) { + log.Debugf(msg, args...) +}