Skip to content
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

Move exception stack trace to ECS-compliant field for StructlogFormatter #97

Merged

Conversation

ndoornekamp
Copy link
Contributor

When using the StructlogFormatter, logs with exceptions (e.g. produced by using logger.exception(...)) currently result in a exception key at the root of the log, which is not a valid ECS field. It should be in the error.stack_trace field instead.

This PR addresses a small part of the disparity between the StructlogFormatter and the StdlibFormatter . Until that is addressed in it's entirety, this patch will help users of this package (like myself) to output logs that comply with the ECS specification.

@cla-checker-service
Copy link

cla-checker-service bot commented Jul 21, 2023

💚 CLA has been signed

Copy link
Contributor

@basepi basepi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! I made a small fix to use pytest fixtures in your test.

@basepi basepi enabled auto-merge (squash) July 24, 2023 18:00
@ndoornekamp
Copy link
Contributor Author

Thanks for the quick review! Is there an ETA for the release?

@basepi
Copy link
Contributor

basepi commented Jul 25, 2023

Well, if I can ever get the docs build to actually go, I can probably release it in the next week or two. 😅

@basepi
Copy link
Contributor

basepi commented Jul 25, 2023

@elasticmachine, run elasticsearch-ci/docs

@basepi basepi disabled auto-merge July 25, 2023 16:20
@basepi
Copy link
Contributor

basepi commented Jul 25, 2023

@elasticmachine, run elasticsearch-ci/docs

@basepi basepi enabled auto-merge (squash) July 25, 2023 16:29
@basepi basepi merged commit 9312971 into elastic:main Jul 25, 2023
@ndoornekamp ndoornekamp deleted the move-exception-stack-trace-to-ecs-field branch July 25, 2023 18:41
@basepi
Copy link
Contributor

basepi commented Aug 16, 2023

@ndoornekamp This is released: https://github.com/elastic/ecs-logging-python/releases/tag/2.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants