[
https://issues.apache.org/jira/browse/LOG4J2-542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13908266#comment-13908266
]
Joern Huxhorn commented on LOG4J2-542:
--------------------------------------
StackTrace string shouldn't be created at all. It will only cost performance
creating it and needs to be parsed on the receiving end, i.e. double impact. It
also introduces another opportunity for bugs since toString and parsing of
Throwables isn't entirely trivial since the addition of Suppressed.
Use StackTraceElement[] and StackTracePackageElement[] instead or rather go for
a single ExtendedStackTraceElement[] like Logback. Going the
ExtendedStackTraceElement path would also prevent the undefined state that
StackTraceElement[] and StackTracePackageElement[] length differ.
A single String would also prevent the serialization mechanism from identifying
duplicate entries. If there are two STEs with the same class name then
serialization will detect this and reference the previous String instead of
sending it again. The same would happen if the entire STE is the same like it's
the case with nested exceptions sharing the same STE.
> LogEvents with exceptions fail to deserialize
> ---------------------------------------------
>
> Key: LOG4J2-542
> URL: https://issues.apache.org/jira/browse/LOG4J2-542
> Project: Log4j 2
> Issue Type: Bug
> Components: Appenders
> Affects Versions: 2.0-rc1
> Reporter: Joern Huxhorn
> Priority: Critical
>
> Events serialized by
> <Socket name="Socket" host="localhost" port="4560" protocol="TCP">
> <SerializedLayout />
> </Socket>
> are suddenly containing unchanged serialized exceptions again. This was
> already working in earlier versions.
> Doing so means that receiving such log-events is impossible if the exception
> class is not available in the receiving application. This is the main reason
> for ThrowableProxy.
> This is caused by
> org.apache.logging.log4j.core.impl
> public class ThrowableProxy {
> private final Throwable throwable;
> }
> The throwable field would have to be transient and the info of the Throwable
> would have to be added to ThrowableProxy. This may be the only necessary
> change but I'm not sure.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]