You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@logging.apache.org by "T3rm1 (JIRA)" <ji...@apache.org> on 2017/06/15 09:14:00 UTC

[jira] [Updated] (LOG4J2-1941) Formatting of stacktrace changed to wrong format for exceptions with no message

     [ https://issues.apache.org/jira/browse/LOG4J2-1941?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

T3rm1 updated LOG4J2-1941:
--------------------------
    Description: 
Bug did not occur in 2.5.

The output for the stacktrace of a Throwable has changed after 2.5 (I think in 2.7). The behavior was that no exception message was printed when it was null. RIght now it will always print the message and in case of null it just prints "null". This is even different to the default printStackTrace() formatting which omits the message when it is null.

The problem is here: https://github.com/apache/logging-log4j2/blob/log4j-2.8.2/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxy.java#L459

The code always prints a colon and the message. There should be a null check.

  was:
Bug did not occur in 2.5.

The output for the stacktrace of a Throwable has changed after 2.5. The behavior was that no exception message was printed when it was null. RIght now it will always print the message and in case of null it just prints "null". This is even different to the default printStackTrace() formatting which omits the message when it is null.

The problem is here: https://github.com/apache/logging-log4j2/blob/log4j-2.8.2/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxy.java#L459

The code always prints a colon and the message. There should be a null check.


> Formatting of stacktrace changed to wrong format for exceptions with no message
> -------------------------------------------------------------------------------
>
>                 Key: LOG4J2-1941
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1941
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.7, 2.8.2
>            Reporter: T3rm1
>
> Bug did not occur in 2.5.
> The output for the stacktrace of a Throwable has changed after 2.5 (I think in 2.7). The behavior was that no exception message was printed when it was null. RIght now it will always print the message and in case of null it just prints "null". This is even different to the default printStackTrace() formatting which omits the message when it is null.
> The problem is here: https://github.com/apache/logging-log4j2/blob/log4j-2.8.2/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxy.java#L459
> The code always prints a colon and the message. There should be a null check.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)