[ https://issues.apache.org/jira/browse/LOG4J2-1676?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Joern Huxhorn updated LOG4J2-1676: ---------------------------------- Attachment: 0004-Using-Throwable-of-Message-if-not-explicitly-given.patch 0003-Using-Throwable-of-Message-if-available.patch 0002-Testing-Message-Throwable-handling.patch 0001-Refactored-AbstractLoggerTest.patch 0001 is a refactoring of {{AbstractLoggerTest}} without any change to its functionality. {{AbstractLoggerTest}} itself is no longer extending {{AbstractLogger}}. This enables the use of different {{AbstractLogger}} implementations in different testing contexts in a more straightforward way. It's now also more obvious what is actual test code and what is just code supporting the tests. 0002 is implementing the tests for the desired functionality. Some (the ones expecting a {{Throwable}}) will fail. 0003 is implementing the desired functionality for all relevant {{log}}/{{debug}} etc. methods. 0004 is implementing the desired functionality for {{MessageSupplier}}/{{Supplier}} methods. > Use Message.getThrowable() in log(Message) methods > -------------------------------------------------- > > Key: LOG4J2-1676 > URL: https://issues.apache.org/jira/browse/LOG4J2-1676 > Project: Log4j 2 > Issue Type: Bug > Affects Versions: 2.5, 2.6, 2.7 > Reporter: Joern Huxhorn > Attachments: 0001-Refactored-AbstractLoggerTest.patch, > 0002-Testing-Message-Throwable-handling.patch, > 0003-Using-Throwable-of-Message-if-available.patch, > 0004-Using-Throwable-of-Message-if-not-explicitly-given.patch > > > All {{log(Message)}} methods should use {{Message.getThrowable()}}, e.g. > {code:java} > public void debug(final Message msg) { > logIfEnabled(FQCN, Level.DEBUG, null, msg, msg != null ? > msg.getThrowable() : null); > } > {code} > instead of the current > {code:java} > public void debug(final Message msg) { > logIfEnabled(FQCN, Level.DEBUG, null, msg, null); > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-dev-h...@logging.apache.org