On Fri, May 29, 2015 at 1:03 AM, Mikael Ståldal <[email protected]> wrote:
> Now when this is changed, what is the actual purpose for > ThreadContextMap.getCopy() and ThreadContext.getContext()? > That's probably a question for Ralph... Gary > It seems like the only usage is > in org.apache.logging.slf4j.Log4jMDCAdapter. > > > On Fri, May 29, 2015 at 2:14 AM, Gary Gregory <[email protected]> > wrote: > >> Please verify and close: [LOG4J2-1033] SimpleLogger creates unnecessary >> Map objects by calling ThreadContext.getContext() instead of >> getImmutableContext(). >> >> Gary >> >> On Thu, May 28, 2015 at 3:31 AM, Mikael Ståldal < >> [email protected]> wrote: >> >>> From org.apache.logging.log4j.simple.SimpleLogger, line 147-151: >>> >>> if (showContextMap) { >>> final Map<String, String> mdc = ThreadContext.getContext(); >>> if (mdc.size() > 0) { >>> sb.append(SPACE); >>> sb.append(mdc.toString()); >>> sb.append(SPACE); >>> } >>> } >>> >>> >>> Why not use ThreadContext.getImmutableContext() here? >>> >>> >>> -- >>> [image: MagineTV] >>> >>> *Mikael Ståldal* >>> Senior backend developer >>> >>> *Magine TV* >>> [email protected] >>> Regeringsgatan 25 | 111 53 Stockholm, Sweden | www.magine.com >>> >>> Privileged and/or Confidential Information may be contained in this >>> message. If you are not the addressee indicated in this message >>> (or responsible for delivery of the message to such a person), you may >>> not copy or deliver this message to anyone. In such case, >>> you should destroy this message and kindly notify the sender by reply >>> email. >>> >> >> >> >> -- >> E-Mail: [email protected] | [email protected] >> Java Persistence with Hibernate, Second Edition >> <http://www.manning.com/bauer3/> >> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/> >> Spring Batch in Action <http://www.manning.com/templier/> >> Blog: http://garygregory.wordpress.com >> Home: http://garygregory.com/ >> Tweet! http://twitter.com/GaryGregory >> > > > > -- > [image: MagineTV] > > *Mikael Ståldal* > Senior backend developer > > *Magine TV* > [email protected] > Regeringsgatan 25 | 111 53 Stockholm, Sweden | www.magine.com > > Privileged and/or Confidential Information may be contained in this > message. If you are not the addressee indicated in this message > (or responsible for delivery of the message to such a person), you may not > copy or deliver this message to anyone. In such case, > you should destroy this message and kindly notify the sender by reply > email. > -- E-Mail: [email protected] | [email protected] Java Persistence with Hibernate, Second Edition <http://www.manning.com/bauer3/> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/> Spring Batch in Action <http://www.manning.com/templier/> Blog: http://garygregory.wordpress.com Home: http://garygregory.com/ Tweet! http://twitter.com/GaryGregory
