Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
0.9.15
-
None
-
None
-
java version "1.6.0_12"
Java(TM) SE Runtime Environment (build 1.6.0_12-b04)
Java HotSpot(TM) Client VM (build 11.2-b01, mixed mode, sharing)
slf4j-api:1.5.6
Description
package loggerbug;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Loggerbug
{
private static final Logger logger = LoggerFactory.getLogger(Loggerbug.class);
static class ThrowsToString {
@Override
public String toString()
}
public static void main(String[] args)
{
ThrowsToString probe = new ThrowsToString();
logger.info("probe is {}", probe);
System.out.println("no exception");
}
}
prints "no exception" with logback-classic, but with slf4j-simple output is:
Exception in thread "main" java.lang.RuntimeException: from toString
at loggerbug.Loggerbug$ThrowsToString.toString(Loggerbug.java:13)
at java.lang.String.valueOf(String.java:2827)
at java.lang.StringBuffer.append(StringBuffer.java:219)
at org.slf4j.helpers.MessageFormatter.deeplyAppendParameter(MessageFormatter.java:237)
at org.slf4j.helpers.MessageFormatter.arrayFormat(MessageFormatter.java:196)
at org.slf4j.helpers.MessageFormatter.format(MessageFormatter.java:138)
at org.slf4j.impl.SimpleLogger.formatAndLog(SimpleLogger.java:222)
at org.slf4j.impl.SimpleLogger.info(SimpleLogger.java:258)
at loggerbug.Loggerbug.main(Loggerbug.java:20)