-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuration for formatting Throwable stack traces #103
Comments
I have the same requirement as this and would preferably use the ecs encoder with our logback.xml, if possible. I'm currently using the logback logstash encoder along with a ShortenedThrowableConverter to achieve this requirement at the moment. Would it be possible to expose a property in the ecs-encoder to allow the user to configure any ThrowableConverter in their logback file?
|
That sounds like a useful feature! The easiest way to integrate that would be to filter the output of ecs-logging-java/ecs-logging-core/src/main/java/co/elastic/logging/EcsJsonSerializer.java Lines 235 to 251 in 80e1f44
Some suggestions for configuration options:
|
I found the easiest way to integrate this is to reuse the existing This commit solved the issue I highlighted in my comment above for the logback encoder. I know this may not be the solution you guys would want to go with but it would be good to get feedback on it. |
While this is indeed only a solution that works for logback and no generic one, I think there's great value in being able to re-use existing I'd happily accept a PR adding support for custom |
I also would like to see this feature and I wonder if there's a way to tap into the existing capabilities of logback and log4j2 as they already support syntax that is roughly:
See: https://logback.qos.ch/manual/layouts.html |
I've started this PR to allow specifying a pattern to be applied when rendering |
I'd like to see more options for how stack traces are formatted in the ECS logs to help in reducing the size of logs.
Some examples:
Ideally a configuration option could override the formatting of the stack trace through an interface implementation provided by the application. That implementation could return a
String[]
orStream<String>
of the formatted stack frames which are then added to the ECS log either as a JSON string or an array of strings.I'd be happy to work on a PR for this if there is interest in it being included.
The text was updated successfully, but these errors were encountered: