remote_syslog2 icon indicating copy to clipboard operation
remote_syslog2 copied to clipboard

omit newline characters

Open goodale opened this issue 2 years ago • 1 comments

I am using the log4j2 JSON layout with compact="true" setting. papertrails (papertrailsapp.com) is not recognizing the data as JSON and their support folks think the issue is that remote_syslog2 is adding newline characters.

Is there a way to omit remote_syslog2 from doing this?

goodale avatar Sep 23 '21 16:09 goodale

After some additional research, we've determined that the log4j2 JSON situation boils down to this:

  • compact=false (default) results in Papertrail receiving JSON messages split up into multiple lines
  • compact=true results in no newlines at all, which might prevent remote_syslog2 from sending anything at all
  • The solution is compact=true eventEol=true, which keeps each individual JSON message on its own line, without adding any extra newlines.

I believe Papertrail Support reached out with this new information, but please let us know if there's still any trouble.

markdascher avatar Sep 29 '21 20:09 markdascher