Skip to content

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

Merged
basepi merged 4 commits into
elastic:mainfrom
ndoornekamp:move-exception-stack-trace-to-ecs-field
Jul 25, 2023
Merged

Move exception stack trace to ECS-compliant field for StructlogFormatter#97
basepi merged 4 commits into
elastic:mainfrom
ndoornekamp:move-exception-stack-trace-to-ecs-field

Conversation

@ndoornekamp

Copy link
Copy Markdown
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

cla-checker-service Bot commented Jul 21, 2023

Copy link
Copy Markdown

💚 CLA has been signed

@basepi basepi left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

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

@basepi

basepi commented Jul 25, 2023

Copy link
Copy Markdown
Contributor

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

@basepi

basepi commented Jul 25, 2023

Copy link
Copy Markdown
Contributor

@elasticmachine, run elasticsearch-ci/docs

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

basepi commented Jul 25, 2023

Copy link
Copy Markdown
Contributor

@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

basepi commented Aug 16, 2023

Copy link
Copy Markdown
Contributor

@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