feat(logging): Include exception_name#320
Merged
Merged
Conversation
heitorlessa
approved these changes
Mar 9, 2021
Contributor
heitorlessa
left a comment
There was a problem hiding this comment.
LGTM - We can add either in this or in another PR a mention that the name of the exception will be available in another record to ease analysis exceptions over time: https://awslabs.github.io/aws-lambda-powertools-python/core/logger/#logging-exceptions
heitorlessa
approved these changes
Mar 9, 2021
Contributor
heitorlessa
left a comment
There was a problem hiding this comment.
Great to have that one - been long overdue for me too. I'll make a PR before we release it to add a sample in the docs on how to create stats for it :)
Thank you again!
heitorlessa
added a commit
that referenced
this pull request
Mar 9, 2021
…tools-python into develop * 'develop' of https://github.com/awslabs/aws-lambda-powertools-python: feat(logging): Include exception_name (#320) chore: remove gatsby mention as migrated completed refactor(parameters): Consistently reference env (#319) docs(metrics): remove minimum dimensions docs: Correct code examples (#317) docs(metrics): Correct code examples in markdown (#316) fix(idempotency): TypeError when calling is_missing_idempotency_key with an int (#315) docs(metrics): Corrections to the code examples (#314) fix(idempotency): Correctly handle save_inprogress errors (#313)
This was referenced Mar 18, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes:
Add
exception_nameto the loggingExample:
Would log out :
{ "level": "ERROR", "location": "<module>:4", "message": "Received an exception", "timestamp": "2020-08-28 18:11:38,886", "service": "service_undefined", "sampling_rate": 0.0, "exception_name":"ValueError", "exception": "Traceback (most recent call last):\n File \"<input>\", line 2, in <module>\nValueError: something went wrong" }Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.