Markers are sent with Brackets. Like "[MARKER_NAME]" instead of "MARKER_NAME" without brackets
rafael-brier opened this issue · 1 comments
Describe the bug
https://github.com/osiegmar/logback-gelf/blob/v6.0.1/src/main/java/de/siegmar/logbackgelf/mappers/MarkerFieldMapper.java
The bug is in the following Mapper, it is calling "toString" on "ArrayList", instead, it should call toString() for each Marker and custom join.
If the markerList has a single element or multiElements, it will be send like this:
"[marker1,marker2,marker3]"
The bug was introduced in this commit:
8e5eb63
Additional context
Version used -> anyone after the commit
This change was intentionally made in version 5.0.0 to reveal the nesting of markers.
The test case of the referred commit 8e5eb63 shows the following change:
-assertEquals("FIRST, SECOND, THIRD", jsonNode.get("_marker").textValue());
+assertEquals("[FIRST [ SECOND ], THIRD]", jsonNode.get("_marker").textValue());
Where SECOND
is nested inside FIRST
and THIRD
is not nested.
If you want to revert to the old behavior, you need to implement a custom field mapper as shown in #87.
What downsides have you experienced with the new format?