Issue Type: Bug Bug
Affects Versions: 1.1.3
Assignee: Logback dev list
Components: logback-classic
Created: 17/Jun/15 11:54 AM
Description:

This issue reports on a regression introduced in 1.1.*. In 1.0.13 the following test program:

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Test
{
private static final Logger LOGGER = LoggerFactory.getLogger(Test.class);

public static void main(String[] args)
{
LOGGER.warn("foo {} {}", "bla", new Exception("bar"));
}
}

logs

11:45:29.278 [main] WARN Test - foo bla java.lang.Exception: bar

In 1.1.1 the same program logs:

11:46:03.664 [main] WARN Test - foo bla {}
java.lang.Exception: bar
at Test.main(Test.java:14) [tmp/:na]

Thus in 1.1.1 logback unconditionally removes the exception from the argument array and logs the stack trace despite there being a placeholder for it in the pattern.

Since SLF4J has a special method for the case of logging an exception (Logger#warn(String,Throwable)), I would expect the the behavior observed with 1.0.* to be the correct one.

Project: logback
Priority: Major Major
Reporter: Gerd Behrmann
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira