logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Sicker <boa...@gmail.com>
Subject Re: [2/2] logging-log4j2 git commit: [LOG4J2-1299] Add pattern converter for thread id and priority in PatternLayout.
Date Tue, 01 Mar 2016 22:53:19 GMT
Thread.getId() just returns a field value.

On 1 March 2016 at 16:04, Gary Gregory <garydgregory@gmail.com> wrote:

> YW. I might not be able to get back to this until tonight or tomorrow so
> feel free to tweak.
>
> Gary
> On Mar 1, 2016 1:53 PM, "Remko Popma" <remko.popma@gmail.com> wrote:
>
>> Gary, thanks for doing the work on this!
>>
>> There's no need to cache the thread ID or priority in the
>> ThreadNameCachingStrategy, we can just ask the Thread.currentThread().
>>
>> The reason the thread name is cached is that Thread.getName() is
>> implemented as a JNI method returning a char[] array, which is then wrapped
>> in a new String. There's significant overhead with that. Obtaining an
>> int/long should not have that drawback.
>>
>> (Although I haven't checked the implementation on Thread, I hope they're
>> not expensive JNI methods, that would change things...)
>>
>> Directly calling the relevant methods on Thread also means we don't need
>> to autobox the values which is nice.
>>
>> Sent from my iPhone
>>
>> > On 2016/03/02, at 3:43, ggregory@apache.org wrote:
>> >
>> > ThreadNameCachingStrategy
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-dev-help@logging.apache.org
>>
>>


-- 
Matt Sicker <boards@gmail.com>

Mime
View raw message