One other thing. I would recommend changing your code below to

public void error(final Throwable t, final String format, final Object... 
values) {
    this.logger.error(new StringFormattedMessage(format, values), t);
}

This way String.format() isn't called unless the event is going to be logged.

I'm not sure why your error method is logging at debug.

Ralph


On Oct 4, 2012, at 11:29 AM, Gary Gregory wrote:

> Hi All:
> 
> In 2.0-Beta1, I have:
> 
>     public void error(final Throwable t, final String format, final Object... 
> values) {
>         this.logger.debug(String.format(format, values), t);
>     }
> 
> The formatted string is logged to the console but not the Exception.
> 
> Am I missing something?
> 
> My config looks like this:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <configuration status="OFF">
>   <appenders>
>     <Console name="Console" target="SYSTEM_OUT">
>       <PatternLayout pattern="%d{ ISO8601 } [%t] %-5level: %msg%n" />
>     </Console>
>   </appenders>
>   <loggers>
>     <logger name="com.foo" level="DEBUG" />
>     <logger name="com.foo.bar" level="INFO" />
>     <logger name="com.gargoylesoftware" level="INFO" />
>     <root level="INFO">
>       <appender-ref ref="Console" />
>     </root>
>   </loggers>
> </configuration>
> 
> Merci!
> -- 
> E-Mail: garydgreg...@gmail.com | ggreg...@apache.org 
> JUnit in Action, 2nd Ed: http://bit.ly/ECvg0
> Spring Batch in Action: http://bit.ly/bqpbCK
> Blog: http://garygregory.wordpress.com 
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory

Reply via email to