MDC in Thread #35134
Unanswered
artsoftprivate
asked this question in
Q&A
MDC in Thread
#35134
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi folks! I need help...
I have written a web service with Quarkus and log everything nicely in the log file. So far so good :-)
From my web service, I call another web service asynchronously in a new thread. There is no need to wait for the thread to finish.
Within this thread, there is only a need to monitor a few data and log them into the log file. When I build and test locally (so I'm in Quarkus DEV mode, IDE is IntelliJ), I see in the thread my MDC data (self-filled) in the log console. So far, so good as well :-)
However, when I build a native image from my code and launch it in Docker, all log entries written by the thread are completely filled with an empty MDC: "mdc":{ } ..... I have also already banished the "Map<String, String>" of the main MDC into a ThreadLocal instance and access it in the thread in order to explicitly reset and renew the MDC in the thread again. But the same effect: In every log entry written in the thread, the MDC always remains empty! And nobody knows why...
I'm going crazy!!!! Maybe you can help here?
Best regards
ART
Beta Was this translation helpful? Give feedback.
All reactions