Closed nehaev closed 8 months ago
Hi @gerhardj-b, yes, this ticket is about adding a support for a json layout. Currently only a plain text layout is supported, so no surprise it doesn't work for json.
Alright, thanks for the confirmation.
To anyone struggling with the same issue, I found a workaround for now that works for me:
<pattern>
{
"level":"%level",
"class":"%logger{36}",
"thread":"%thread",
"message": "%replace(%message){'"','\\"'}",
"exception":"%replace(%replace(%ex){'"','\\"'}){'\n','\\n'}"
}
</pattern>
Currently, I keep getting malformed JSON when using the configuration as in https://github.com/loki4j/loki-logback-appender/issues/201#issuecomment-1862159478_
Do I suspect correctly, that this problem would be solved by this issue? Or is there any configuration right now, that I can use to fix this problem?
Below is an example of such a malformed message, that cannot be parsed with Grafana: