opentracing-contrib / java-spring-jaeger

Apache License 2.0
257 stars 95 forks source link

Cannot print traceid in application logs #49

Open Sam-Kruglov opened 5 years ago

Sam-Kruglov commented 5 years ago

Regarding this issue https://stackoverflow.com/questions/51929412/add-jaeger-trace-id-and-span-id-to-log4j2-logs

I couldn't find any other way to do it. Would be better to use jaeger API directly, rather than through zipkin adapter

geoand commented 5 years ago

@pavolloffay any input on this?

pavolloffay commented 5 years ago

The OpenTracing API 0.32.0 added getters for trace/span IDs so now it should be doable. However we haven't implemented it yet. It will be done as part of this ticket https://github.com/opentracing-contrib/java-spring-cloud/issues/92#issue-295123607

Feel free to submit a PR for it if you are interested.

dbsheta commented 5 years ago

We have done so by writing an interceptor which gets the trace and span IDs using opentracing api and add them to MDC.

dbsheta commented 5 years ago

We are soon going to remove the interceptor and use AOP instead