[logback-user] commons-logging -> sl4j -> logback

Brett Walker brett.walker at geometryit.com
Fri Feb 8 00:35:46 CET 2013


Yes David,

This avoids calling the toString() method on the objects until the log message is actually required to be logged.

If the toString() methods is an expensive method, time-wise, this time is avoided when the log message is not needed.

Look at http://logback.qos.ch/manual/architecture.html if you have not already. Go to a section called 'Better alternative' near the bottom of the page.

Brett

From: logback-user-bounces at qos.ch [mailto:logback-user-bounces at qos.ch] On Behalf Of David Harkness
Sent: Friday, 8 February 2013 10:29 AM
To: logback users list
Subject: Re: [logback-user] commons-logging -> sl4j -> logback

On Thu, Feb 7, 2013 at 1:11 PM, Brett Walker <brett.walker at geometryit.com<mailto:brett.walker at geometryit.com>> wrote:
Log.debug("The object is {0}", object);

Are positional parameters a new feature in Logback? I just started using it and all the examples I've see use empty braces with no way to reorder the parameters via the message. In other words, I would expect to see this:

    Log.debug("The object is {}", object);

David

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20130208/abcaa684/attachment.html>


More information about the Logback-user mailing list