logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Gregory (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4J2-939) end of line not handled correctly by ThrowableProxy
Date Sun, 25 Jan 2015 17:33:35 GMT

    [ https://issues.apache.org/jira/browse/LOG4J2-939?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14291190#comment-14291190

Gary Gregory commented on LOG4J2-939:

The patch I created for the proposed solution breaks a lot of tests. If you want to pursue
this, please provide a better patch ;-)


> end of line not handled correctly by ThrowableProxy
> ---------------------------------------------------
>                 Key: LOG4J2-939
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-939
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.1
>         Environment: Windows 7
>            Reporter: Mika Riekkinen
>            Priority: Minor
>         Attachments: LOG4J2-939.diff
> Noticed that EOL is not handled correctly on stacktraces. If a logfile is opened with
notepad, stacktraces are all printed on one line only, wihtout
> linebreaks after each stacktrace element.
> Made some digging, and indeed there seems to be some inconsistency how EOL is handled.
> ExtendedThrowablePatternConverter uses Constants.LINE_SEPARATOR to split stacktrace into
>    final String[] array = trace.split(Constants.LINE_SEPARATOR);
> But a ThrowableProxy, that generates the trace above uses hardocoded
> '\n' character throughout the source code.
> Compiled a new version of ThrowableProxy, where each '\n' is replaced 
> with Constants.LINE_SEPARATOR, and stacktraces started to work ok.
> I also had to change ExtendedThrowablePatternConverterTest, so that
> generation of expected variable does not strip '\r' character:
> final String expected = sw.toString();//.replaceAll("\r", Strings.EMPTY);

This message was sent by Atlassian 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