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 "Ralph Goers (JIRA)" <ji...@apache.org> on 2016/04/27 07:49:12 UTC

[jira] [Assigned] (LOG4J2-1332) Null/empty messages are not handled properly in RFC5424Layout

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

Ralph Goers reassigned LOG4J2-1332:
-----------------------------------

    Assignee: Ralph Goers

> Null/empty messages are not handled properly in RFC5424Layout
> -------------------------------------------------------------
>
>                 Key: LOG4J2-1332
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1332
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Layouts
>            Reporter: Michael Day
>            Assignee: Ralph Goers
>
> In the following code snippet, you can see that null/empty messages are not appended to the buffer. This results in a violation of RFC5424.
> {code}
>     private void appendMessage(StringBuilder buffer, LogEvent event) {
>         Message message = event.getMessage();
>         String text = message instanceof StructuredDataMessage?message.getFormat():message.getFormattedMessage();
>         if(text != null && text.length() > 0) {
>             buffer.append(' ').append(this.escapeNewlines(text, this.escapeNewLine));
>         }
>         ...
> }
> {code}



--
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