rgoers commented on PR #820: URL: https://github.com/apache/logging-log4j2/pull/820#issuecomment-1107648506
Background: As we all know Log4j 1.x supports an MDC and NDC. All this time I thought SLF4J did too but it seems it has only supported the MDC. Recently it seems that Ceki has tried to add support for things like the [W3C Trace Context](https://www.w3.org/TR/trace-context/) and the [Open Tracing API](https://opentracing.io/docs/). Rather than introduce the NDC to SLF4J he decided a Map of queues would be better. I really can't argue with the idea that it is better to have a Map of queues rather than a single queue. I've always found the NDC to be problematic. To be honest, I would have preferred that instead of a Map of queues that instead this be looked at adding support for Lists of elements to the existing ThreadContextMap. That said, lists and queues have a lot in common so one could easily imagine it being used to simply contain a set of elements in a key in the ThreadContextMap. In any case, to support SLF4J 2.0 we have to support whatever Ceki adds whether we like it or not. In discussing this with Piotr we wanted to avoid affecting the Log4j 2 API. That means we need a way to make the existing data structures work. The only way we could come up with was converting the list to a String since that is all the ThreadContext supports. As Piotr says, we would prefer the bridge not depend on Log4j core. In addition, I am going to require JsonReader in Log4j API in 3.0 for https://cwiki.apache.org/confluence/display/LOGGING/Properties+Enhancement. JsonReader is simple and isn't like including Jackson or Gson and is less complicated than some of the other utility classes we have in Log4j API. Because it provides functionality required at the API level I see no problem with including it. While JsonWriter is more complicated than JsonReader it isn't by much. Of course, we could simple add the support to the API but as with Piotr I don't think a list of stacks will be much more popular than the NDC. But allowing the ThreadContextMap to also contain collections as well as String values could be. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
