[logback-dev] Parameterized logging

Joern Huxhorn jhuxhorn at googlemail.com
Wed Mar 24 16:33:52 CET 2010


On 24.03.2010, at 16:18, Pavel Bortnovskiy wrote:

>
> Hello:
>
> I am a new subscriber to this list, so please forgive me if these  
> questions have already been asked and answered.
>
> Being quite experienced with log4j, migrating to Logback would  
> probably be a relatively easy exercise. However, while reading the  
> manual, I have a few questions, which might be best addressed to the  
> developers, rather than the users.
>
> 1) using parameterized logging instead of wrapping the log statment  
> in a conditional isEnabled, is very convenient, however I wonder  
> whether there is an implementation of printf
> function (or whether there are plans to do so). http://java.sun.com/j2se/1.5.0/docs/api/java/util/Formatter.html#format(java.lang.String 
> , java.lang.Object...)
> Implementation of log statements with such functionality and a  
> variable arg list would be fairly trivial, but I found no references  
> to such in Logback Javadocs, FAQ or search engine queries.
>
> 2) If the answer to (1) is NO, then is there an easy way to extend  
> Logback to incorporate such functions?

Hi Pavel,

the answer is no, but varargs as well as extension of the  
parameterization mechanism is currently discussed in the following  
thread on the SLF4J-Dev list:
http://thread.gmane.org/gmane.comp.java.slf4j.devel/2805

Cheers,
Joern.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://qos.ch/pipermail/logback-dev/attachments/20100324/2333785d/attachment-0001.html>


More information about the logback-dev mailing list