ppkarwasz commented on PR #2419:
URL: https://github.com/apache/logging-log4j2/pull/2419#issuecomment-2028898990

   >    1. In our discussion yesterday we agreed `ThreadContext` (and 
presumably the `ThreadContextMap`s) should be deprecated. That would include 
`ObjectThreadContextMap`.
   
   I would love that, but after looking at our SLF4J integrations I am not sure 
any more we can do that.
   
   >     3. Even if I could find a `ThreadLocal` to reuse I still don't 
understand why you are so reticent about adding a new one. After all, if 
ContextScope isn't being used then the ThreadLocal won't be instantiated. 
Likewise, one would imagine that if ContextScope is being used then the 
ThreadContext won't be.
   
   I am reticent about adding a new thread local, because propagating the 
`ThreadContextMap` is well supported by many tools, while the new `ThreadLocal` 
in `ScopedContext` will require many new integrations.
   
   As far as I remember JBoss LogManager also has an MDC that can have object 
values. In this case reusing `ThreadContextMap` will allow you to have an 
out-of-the-box integration.
   
   >     4. I am not sure what it would mean to "Take a snapshot" of a 
ScopedContext or why one would want to do it.
   
   By "taking a snapshot" I mean retrieving the `Foo` from the 
`ThreadLocal<Foo>` if `Foo` is immutable or make a copy of `Foo` otherwise).
   


-- 
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]

Reply via email to