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

   
   @ppkarwasz 
   I really don't see the point of using ObjectThreadContextMap. 
   
   1. In out discussion we agreed ThreadContext (and presumably the 
ThreadContextMaps) should be deprecated. That would include 
ObjectThreadContextMap.
   2. The only implementations of that interface declare:
   ```
       protected final ThreadLocal<StringMap> localMap;
   ```
   which isn't particularly helpful.
   
   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.
   4. I am not sure what it would mean to "Take a snapshot" of a ScopedContext 
or why one would want to do it. I suppose I could imagine saving the topmost 
map as JSON for transport, but since it can contain objects it would almost 
surely have to serialize only the redered String variation of the objects in 
the map as it would be impossible to deserialized the map without know ing what 
is in it.


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