logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ralph Goers <ralph.go...@dslextreme.com>
Subject Re: log4j2 parameterized msg with throwable
Date Thu, 29 Sep 2011 06:29:16 GMT

On Sep 19, 2011, at 1:44 AM, Joern Huxhorn wrote:

> 
> On 19.09.2011, at 09:36, Ralph Goers wrote:
> 
>> 
>> On Sep 18, 2011, at 4:56 PM, Joern Huxhorn wrote:
>> 
>>> 
>>> On 19.09.2011, at 01:29, Ralph Goers wrote:
>>> 
>>>> 
>>>> On Sep 18, 2011, at 3:01 PM, Joern Huxhorn wrote:
>>>> 
>>>>> Sorry, I was confused and mixed something up...
>>>>> 
>>>>> I *planned* to implement a thread-specific sequence number but never
did so. I also considered logging the ThreadGroup-hierarchy but didn't do so, yet, because
of the expected performance impact.
>>>>> 
>>>>> Which reminds me, completely off-topic, of another idea concerning a
custom Message implementation:
>>>>> A ThreadDumpMessage that would not get any parameter at all and would
consist of a ThreadDump if it is actually logged, including the ThreadGroup info etc..
>>>>> This would have helped me immensely in the past. Instead, I had to trigger
thread dumps via SIG_QUIT at a random points of execution.
>>>>> 
>>>>> Such a Message wouldn't be used in production under normal circumstances
but could be enabled in case of strange concurrency issues...
>>>> 
>>>> I added it, but as I said, I wish I knew how to include the locks. 
>>>> 
>>>> FWIW, I could have used this 2 days ago when we were trying to debug just
such a concurrency issue.
>>>> 
>>> 
>>> I think http://download.oracle.com/javase/6/docs/api/java/lang/management/ThreadMXBean.html
could be what you are looking for. 
>>> Haven't given it a try, yet.
>> 
>> Unfortunately, all the good lock information was added in 1.6.  
>> 
> 
> Yes, it is calling for some reflection magic.
> You'd have to reimplement LockInfo and MonitorInfo, though...

I believe I've solved this with the minimum amount of reflection. However, it now requires
that Log4j 2 be compiled with Java 6. It should still be able to run on Java 5. I tried to
declare that in the compiler plugin but it throws an exception if source = 1.6 and target
= 1.5. I believe the enforcer plugin would do it though.

Ralph
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message