logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Struberg <strub...@yahoo.de>
Subject Re: log4j-2.0 questions
Date Wed, 29 Jun 2011 22:11:19 GMT
Hi Ralph!

Txs for clarifying. I thought the user needs to provide that message object. 

Regarding temp object creation: in HotSpot it is now much better than it used to be, but it's
still an overhead.

Btw, regarding Message objects and i18n logs. 
I had this discussion a while back and I still don't get it why it should be useful to internationalize
logs!

Imo no message in any error log or whatever logfile else needs to be internationalized. It
is really a pain if you only get a dumb german error message into your log but all you could
find easily on the internet is english. A Hungarian or Thai local user is doomed anyway...

This is completely different for messages which gets presented to some users, but _not_ for
messages which only a technician will see!

So please revise this approach, it does nothing else than slowing down the logging itself
and fu**n up the log for the poor guy/lady which is looking for a solution on the internet
;)

LieGrue,
strub



--- On Tue, 6/21/11, Ralph Goers <ralph.goers@dslextreme.com> wrote:

> From: Ralph Goers <ralph.goers@dslextreme.com>
> Subject: Re: log4j-2.0 questions
> To: "Log4J Developers List" <log4j-dev@logging.apache.org>
> Date: Tuesday, June 21, 2011, 6:43 AM
> 
> 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
> 
> 

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