Logback automatically includes %ex at the end of the pattern if you don't 
explicitly and you have to specify %noEx to turn it off.  

In Log4j 2 you have to explicitly specify one of %ex, %xEx or %rEx to the end 
of the pattern. There is no equivalent to %noEx since you have to explicitly 
include it. 

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