You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Gary Gregory (JIRA)" <ji...@apache.org> on 2015/06/24 23:46:05 UTC

[jira] [Resolved] (LOG4J2-1068) Exceptions not logged when using TcpSocketServer + SerializedLayout

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

Gary Gregory resolved LOG4J2-1068.
----------------------------------
       Resolution: Fixed
    Fix Version/s: 2.4

Andy,

Thank you for your patch!

Please verify and close.

Keep'em coming...

Gary


> Exceptions not logged when using TcpSocketServer + SerializedLayout
> -------------------------------------------------------------------
>
>                 Key: LOG4J2-1068
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1068
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Pattern Converters
>    Affects Versions: 2.1, 2.2, 2.3
>            Reporter: Andy McMullan
>             Fix For: 2.4
>
>         Attachments: patch.txt
>
>
> This issue was reported in BugZilla bug 57036: https://bz.apache.org/bugzilla/show_bug.cgi?id=57036.   The description there covers the problem well:
> "... in the Method format(final LogEvent event, final StringBuilder toAppendTo) in ExtendedThrowablePatternConverter writing the Stacktrace in the logfile on condition that the Throwable throwable from Log4jLogEvent is not null, but on the Socketserver the Throwable throwable is always null, because it's defined as transient."
> I couldn't find the bug here in Jira, so I'm reporting again in case it has been lost in the migration.
> It's a major problem with a simple fix, so seems like it should be a high priority.
> I've worked around it for now by plugging in my own ExtendedThrowablePatternConverter.  My fix is to change this line:
> if (throwable != null && options.anyLines() {
> to this:
> if ((throwable != null || proxy != null) && options.anyLines()) {



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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