logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralph Goers (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (LOG4J2-216) Detach ThrowableProxy from Throwable
Date Thu, 18 Jul 2013 06:46:50 GMT

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

Ralph Goers resolved LOG4J2-216.

       Resolution: Fixed
    Fix Version/s: 2.0-beta9

Most of this was resolved in revision 1504373. However, ThrowableProxy is being left in the
impl subpackage as it, like Log4jLogEvent are implementation details 
> Detach ThrowableProxy from Throwable
> ------------------------------------
>                 Key: LOG4J2-216
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-216
>             Project: Log4j 2
>          Issue Type: Wish
>    Affects Versions: 2.0-beta4
>            Reporter: Joern Huxhorn
>              Labels: throwable
>             Fix For: 2.0-beta9
> org.apache.logging.log4j.core.impl.ThrowableProxy currently has some downsides:
> 1.) Due to suppressed, that was added in 1.7, it is only possible to receive/handle exceptions
containing suppressed exceptions with 1.7 on both sender and receiver side. A ThrowableProxy
data type that does not extend Throwable could simply implement support for suppressed exceptions
regardless of the Java version in use.
> 2.) It is currently impossible to retrieve the original class name of the Throwable that
was the source of a proxy instance. The data exists in ThrowableProxy (the private name attribute)
but there is no way to access it.
> 3.) There is no way to retrieve commonElementCount.
> 4.) Since ThrowableProxy extends Throwable, getCause and the conditionally available
getSuppressed will return Throwable instances instead of ThrowableProxy instances - even though
the returned instances will always be of type ThrowableProxy. So even if getName() and getCommonElementCount()
would get added, a defensive cast would be necessary to access the data.
> Suggestion:
> Please consider implementing a simple data type without any dependencies introduced by
> See https://github.com/huxi/lilith/blob/master/lilith-data/logging/src/main/java/de/huxhorn/lilith/data/logging/ThrowableInfo.java
for an example.
> This data type should include the following methods:
> - String getName() // the FQCN of the original Throwable class
> - ThrowableProxy getCause()
> - ThrowableProxy[] getSuppressed()
> - int getOmittedElements() (or something similar, commonElementCount)
> Put that data type into org.apache.logging.log4j.core instead of org.apache.logging.log4j.core.impl
(making it part of the public API) and change org.apache.logging.log4j.core.LogEvent.getThrown()
to return a ThrowableProxy instead of Throwable.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org

View raw message