[logback-dev] [JIRA] (LOGBACK-1420) Args array is double trimmed when passing more than one trailing throwable

QOS.CH (JIRA) noreply-jira at qos.ch
Sat Sep 8 07:13:00 CEST 2018


LI CHUANYI created LOGBACK-1420:
-----------------------------------

             Summary: Args array is double trimmed when passing more than one trailing throwable
                 Key: LOGBACK-1420
                 URL: https://jira.qos.ch/browse/LOGBACK-1420
             Project: logback
          Issue Type: Bug
          Components: logback-classic
    Affects Versions: 1.3.0-alpha5
         Environment: java version "10.0.2" 

Windows 10 / IDEA

 

 
            Reporter: LI CHUANYI
            Assignee: Logback dev list
            Priority: Minor


When passing more than one trailing throwable: 

 
{code:java}
Logger logger = LoggerFactory.getLogger(Main.class);
logger.warn("Message1={}, message2={}.", 
        new Exception("I'm ex1"), 
        new Exception("I'm ex2"), 
        new Exception("I'm ex3"));
{code}
Output:

 

12:28:09.687 [main] WARN ch.qos.logback.classic.Main - Message1=java.lang.Exception: I'm ex1, {color:#d04437}message2=\{}{color}.
java.lang.Exception: I'm ex3
 at ch.qos.logback.classic/ch.qos.logback.classic.Main.main(Main.java:10)

 

The second exception is trimmed by MessageFormatter#arrayFormat(String, Object[]) in LoggingEvent#getFormattedMessage(), although throwable had been already extracted in constructor.

 



--
This message was sent by Atlassian JIRA
(v7.3.1#73012)


More information about the logback-dev mailing list