Implement fallback MDC implementation for JUL#190
Conversation
|
@eyalkoren correct me if I'm wrong but I think the idea was to not rely on the MDC from slf4j at all anymore. Instead remove |
jul-ecs-formatter/src/main/java/co/elastic/logging/jul/FallbackMdc.java
Outdated
Show resolved
Hide resolved
Correct, that's the preferable option described in elastic/apm-agent-java#2492 (comment), and the less preferable alternative described is to rely on slf4j MDC |
jul-ecs-formatter/src/main/java/co/elastic/logging/jul/JulMdc.java
Outdated
Show resolved
Hide resolved
jul-ecs-formatter/src/main/java/co/elastic/logging/jul/JulMdc.java
Outdated
Show resolved
Hide resolved
eyalkoren
left a comment
There was a problem hiding this comment.
AFAICT it should be thread-safe as long as we keep the usage as is, but I added a proposal for increasing the chances that it is kept safe in the future as well
Part of elastic/apm-agent-java#2492
Adds a fallback MDC implementation for JUL that can be used by the APM agent, usage within ECS logging will only read any key/values in the MDC, values will be populated by the APM agent.
Checklist