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

Exceptions should use logger.exception, not logger.error #1756

Open
spwoodcock opened this issue Aug 14, 2024 · 0 comments
Open

Exceptions should use logger.exception, not logger.error #1756

spwoodcock opened this issue Aug 14, 2024 · 0 comments
Labels
backend Related to backend code bug Something isn't working effort:low Likely a few hours priority:high Should be addressed as a priority

Comments

@spwoodcock
Copy link
Member

spwoodcock commented Aug 14, 2024

Describe the bug

  • We use log.error in most places, even when exceptions are raised.
  • This is fine when viewing logs in the terminal.
  • However to send via OTEL to tools like Sentry, the traceback is only included if log.exception is used.
    • This is essentially the same as log.error(exc_info=True).
  • If we want the full traceback stack to be included, then we need log.exception("some info", stack_info=True)
@spwoodcock spwoodcock added bug Something isn't working priority:high Should be addressed as a priority backend Related to backend code effort:low Likely a few hours labels Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Related to backend code bug Something isn't working effort:low Likely a few hours priority:high Should be addressed as a priority
Projects
Development

No branches or pull requests

1 participant