JSON Structured logs #667
Unanswered
ARobertsCollibra
asked this question in
Q&A
Replies: 2 comments 2 replies
-
@ARobertsCollibra Hi Adam, JsonAppendeer is currently being implemented. See commit 9e833ec This issue is being tracked under LOGBACK-1734 Documentation should follow shortly |
Beta Was this translation helpful? Give feedback.
1 reply
-
Hi @ceki
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello Everyone,
I am trying to output logs in a JSON structured format that includes the Key Value Pairs (%kvp).
When I use the normal pattern layout I can get close, but there isn't a good way to convert the KVP to native JSON because the Keys aren't in quotes
"
. The best I have found is using%replace
which can getv1="k1" v2="k2"
tov1:"k1",v2:"k2"
I started looking at the code base to see how hard it would be to support
%kvp{json}
as an option and came acrossch.qos.logback.classic.encoder.JsonEncoder
which seems like it would do what I need, but there appears to be zero documentation (at least google doesn't find any) and I can't figure out how to define what fields the encoder outputs.Any suggestions on the best way to move forward?
Thank you,
Adam
Beta Was this translation helpful? Give feedback.
All reactions