Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
1.2.1
-
None
-
Windows, Java 8
Description
When logging exceptions that overwrite toString() then logback ignores the output of it. For example:
class OverridingException extends Exception { @Override public String toString() { return super.toString() + " important additional information"; } }
When used with logback the following code
@Test public void testName() { org.slf4j.Logger logger = LoggerFactory.getLogger(LoggerTest.class); try { throw new OverridingException(); } catch (Throwable t) { logger.error("", t); } }
produces output without the string "important additional information"
2017-03-08 16:44:27 [main] ERROR trial.LoggerTest -
trial.LoggerTest$OverridingException: null
at trial.LoggerTest.testName(LoggerTest.java:32)
while Java Util Logging outputs correctly
Mär 08, 2017 4:44:27 PM trial.LoggerTest testLogging SCHWERWIEGEND: trial.LoggerTest$OverridingException important additional information at trial.LoggerTest.testLogging(LoggerTest.java:22)
Testfile and logback.xml attached.