logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joern Huxhorn <jhuxh...@googlemail.com>
Subject Re: log4j2 parameterized msg with throwable
Date Sat, 17 Sep 2011 20:37:15 GMT

On 17.09.2011, at 21:34, Ralph Goers wrote:

> 
> On Sep 17, 2011, at 12:26 PM, Joern Huxhorn wrote:
> 
>> 
>> The code simply looks like this:
>> public void log(Level level, String messagePattern, Object... args) {
>> 	if (!isEnabled(level)) return;
>> 	ParameterizedMessage message = ParameterizedMessage.create(messagePattern, args);
>> 	performLogging(level, null, message, message.getThrowable());
>> }
> 
> Thanks. This is the source of the bug.  The API is currently not doing message.getThrowable().
I'll fix that shortly.
> 
> But I also do like John's suggestion that ParameterizedMessage and StructuredDataMessage
could be interfaces. What are your thoughts on that?

May make sense.
I'm not sure, yet, where this would be of actual use but I wouldn't rule it out because of
that.

One thing that makes me keeps poking me concerning this suggestion is the fact that the RFC5424
StructuredDataMessage has specific requirements concerning the key-length while other implementations
likely wouldn't. This means that those implementations couldn't simply be exchanged since
RFC5424 would throw an, say, IllegalArgumentException for a key longer than 32 chars while
others wouldn't.

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