[LOGBack-user] Parameterized logging

Sebastien Pennec sebastien at qos.ch
Wed Aug 30 16:30:45 CEST 2006


Hello Rickard,

Thanks for trying logback!

The problem with parametrized logging wasn't on your side.

It's now fixed. I made a test case (ch.qos.logback.classic.MessageFormattingTest), to
check that.

The corrected code was committed. You can checkout the project by using the following
command:
svn co http://svn.qos.ch/repos/logback/trunk DESTINATION_DIR

Nothing special needs to be done in order to use parametrized logging. It's built in 
logback and any configuration can benefit from it.

Thanks for your feedback, do not hesitate to email the list again if you encounter 
any other problems.

Sébastien


Rickard Nilsson a écrit :
> I'm trying to use the parameterized logging feature in LogBack 0.2.5, 
> but I can't get it to work. I'm using a basic configuration:
> 
> <configuration>
> 
>   <appender name="STDOUT"
>     class="ch.qos.logback.core.ConsoleAppender">
>     <layout class="ch.qos.logback.classic.PatternLayout">
>       <param name="pattern"
>         value="%-4relative [%thread] %-5level %class - %msg%n" />
>     </layout>
>   </appender>
> 
>   <root>
>     <level value="debug" />
>     <appender-ref ref="STDOUT" />
>   </root>
> </configuration>
> 
> When logging debug("Hello {}", obj), I get the logging output "Hello 
> {}". Is there anything special you have do do in order to get this 
> working? Any special appenders or layouts? Any special objects as 
> parameters to the logging function?
> 
> 
> Cheers,
>   Rickard
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://qos.ch/mailman/listinfo/logback-user
> 

-- 
Sébastien Pennec
sebastien at qos.ch

Logback: The reliable, generic, fast and flexible logging framework for Java.




More information about the Logback-user mailing list