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

NO-REF: Using exception for logging API errors #381

Merged
merged 2 commits into from
Oct 2, 2024

Conversation

kylevillegas93
Copy link
Contributor

@kylevillegas93 kylevillegas93 commented Sep 30, 2024

Description

  • logger.exception is a shorthand way of including the exception info in the error log:
drb_local_api  | {"timestamp":1727728537921,"message":"Unable to get total counts","log.level":"ERROR","logger.name":"api.blueprints.drbUtils","thread.id":140425797289664,"thread.name":"Thread-2","process.id":1924,"process.name":"MainProcess","file.name":"/src/api/blueprints/drbUtils.py","line.number":57,"entity.type":"SERVICE","error.class":"builtins:Exception","error.message":"Hello"}

Testing

docker compose up; make unit

Copy link
Contributor

@mitri-slory mitri-slory 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.

@kylevillegas93 kylevillegas93 merged commit 52b34ba into main Oct 2, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants