When i produce json logging with loggerfactory it forgets to add commas after each row, any tips? Shall i add something to the logback.xml file?
Logstash encoder doesnt produce correct json format
689 views Asked by AudioBubble At
1
When i produce json logging with loggerfactory it forgets to add commas after each row, any tips? Shall i add something to the logback.xml file?
The output of the
LogstashEncoderis intended to be sent to something that expects line-delimited JSON objects, such as logstash'sjson_linescodec.Note that adding a comma between JSON objects does not make it valid JSON, since there is no leading
[or trailing]for an array.Having said that, you can add comma after each object by configuring a suffix or line separator
For example, to add a suffix: