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: log4j-2.0 questions
Date Tue, 21 Jun 2011 06:43:09 GMT

On Jun 20, 2011, at 11:06 PM, Mark Struberg wrote:

> Hi Gary!
> 
> 
> I'll certainly give it a go.
> Btw, I've seen the Message interface ant the log.info with the Message parameter. Is't
creating a new Message instance way too expensive? 

Expensive compared to what?  The Message object is only created if the first level of filtering
passes. Once you get into creating a LogEvent and then dealing with Layouts, and whatever
I/O appenders are going to do I doubt it matters much. If the Message objects didn't exist
most of the logic in them would have to go somewhere else and they would actually be more
expensive since you would end up with Layouts that have to deal with multiple kinds of objects.
 Furthermore, without Messages logging events with more complex objects such as Structured
Data becomes extremely difficult. I attempted to do that in Logback with the EventData object
but the result is very unsatisfying as the EventData has to be converted to XML format so
that it can be passed through Logback and then converted back into an EventData object in
the Layout and Appender. That mess is what led me to the Message interface (with the help
of Joern Huxhorn).

> I'm kind of a performance slut and I've speeded up OpenWebBeans to be 3x as fast as Spring
(and way faster than guice and Weld too). I especially learned to be really careful to avoid
unnecessary temp object creations.

My understanding of Java 6 is that this is way less of an issue than it used to be.

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