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

Gary Gregory commented on LOG4J2-908:
-------------------------------------

We have two issues here:

The first, which appears simple, is that the footer is never written. The 
JsonLayout class knows to write an ending ']' but its {{getFooter()}} method 
must be called by Log4j. This would only happen when the appender is closed, 
probably when log4j shutsdown.

The second problem is more problematic, we do not have the notion of a log 
event separator. We have header and footer of course. This is not a problem for 
the XML layout of course since there is no such thing as a collection separator 
in XML.

This will need a bit of thinking and fiddling.

Always writing a ',' will not work since you cannot have a dangling ',' in JSON.

> JSONLayout doesn't add a comma between log events
> -------------------------------------------------
>
>                 Key: LOG4J2-908
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-908
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Layouts
>    Affects Versions: 2.1
>            Reporter: Konstantinos Liakos
>
> JSONLayout doesn't output a comma (,) between the log events. This makes it 
> quite difficult to read and deserialize the log files.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to