[
https://issues.apache.org/jira/browse/LOG4J2-2892?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17157046#comment-17157046
]
Ralph Goers commented on LOG4J2-2892:
-------------------------------------
Yes, patches are always welcome. That said, I have had nothing but problems
sending logs in a cloud environment unless they are null terminated. But that
is because I want my log messages to look like they do when logged to a file,
which includes having stack traces with newlines. If you use a newline as a way
to signal terminating events you should not include newlines in the body, which
means your Java stack traces will be pretty ugly.
SeeĀ [http://logging.apache.org/log4j/2.x/manual/cloud.html]. I've attached a
screen shot of what Kibana looks like for a setup like what is documented on
that page.
> GelfLayout can't produce newline delimited events
> -------------------------------------------------
>
> Key: LOG4J2-2892
> URL: https://issues.apache.org/jira/browse/LOG4J2-2892
> Project: Log4j 2
> Issue Type: Improvement
> Components: Layouts
> Affects Versions: 2.12.1, 2.13.3
> Reporter: Jakub Lukes
> Priority: Major
> Attachments: kibana.png
>
>
> Hello, the GelfLayout currently generates either \0 delimiter or no delimiter
> at all. We would like to use GELF for structured logging to files and Docker,
> and for that we need the events to be ended with a newline.
> I propose to add an option to GelfLayout to support this, possibly named
> eventEol to be same as in JsonLayout. I can provide a patch if this will be
> considered a good idea.
> In case the wanted behavior can be achieved without any code change, I would
> welcome such answer too.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)