logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mikael Ståldal <mikael.stal...@magine.com>
Subject Re:
Date Fri, 29 May 2015 08:03:22 GMT
Now when this is changed, what is the actual purpose for
ThreadContextMap.getCopy() and ThreadContext.getContext()?

It seems like the only usage is in org.apache.logging.slf4j.Log4jMDCAdapter.


On Fri, May 29, 2015 at 2:14 AM, Gary Gregory <garydgregory@gmail.com>
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 <mikael.staldal@magine.com
> > 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*
>>  mikael.staldal@magine.com
>>  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: garydgregory@gmail.com | ggregory@apache.org
> 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*
 mikael.staldal@magine.com
 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.

Mime
View raw message