Replies: 2 comments 2 replies
-
The plugin doesn't promise you to have trace ID in the logs, it just does tracing. So this is not a bug as it is not a feature. Trace ID is available when and only when the tracing context exists in the current thread. Spring Gateway provides a complex async module, so, your codes may run in another thread. This is a very normal case. |
Beta Was this translation helpful? Give feedback.
2 replies
-
inelegant way:
using RunnableWrapper, ConsumerWrapper to wrap spring cloud gateway async code, to let skywalking know the context |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Search before asking
Apache SkyWalking Component
Java Agent (apache/skywalking-java)
What happened
Use the log4j2, with agent version 8.10.0, in the log, the tid always display as 'TID: N/A'

like
[2022-06-15 14:53:19.958] [TID: N/A]
but the other service through the gateway has the correct traceId。And we can see the trace in the skywalkig ui
What you expected to happen
the SpringCloudGateway which use log4j2 print the right traceId
How to reproduce
SpringCloudGateway3.1.3
apm-log4j2-2.x:8.10.0
Skywalking 9.0.0
log4j2 xml pattern:
[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%traceId] [%logger{36}] [%thread] [%-5level] %msg%n
Anything else
No response
Are you willing to submit PR?
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions