Skip to content

Encode stacktrace in JSON as part of LoggingEventCompositeJsonObject #811

Answered by philsttr
VannTen asked this question in Q&A
Discussion options

You must be logged in to vote

The net.logstash.logback.composite.loggingevent.StackTraceJsonProvider provided by logstash-logback-encoder writes the stacktrace as a single string field.

logstash-logback-encoder does not have a JsonProvider that breaks up the stacktrace into individual frames as separate fields.

To do so, you would need to implement a custom JsonProvider. The stackoverflow answer you referenced includes an implementation of a custom JsonProvider that breaks up the string produced by the throwable converter. Alternatively, you could write a JsonProvider that writes output directly from the event.getThrowableProxy() (without converting to a string, and then parsing it).

After you write your own custom Js…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@VannTen
Comment options

Answer selected by VannTen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants