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

Enhancement: allow finer tuning LoggingConfig for exception logging #3455

Open
LonelyVikingMichael opened this issue Apr 30, 2024 · 0 comments
Labels
Enhancement This is a new feature or request

Comments

@LonelyVikingMichael
Copy link
Contributor

LonelyVikingMichael commented Apr 30, 2024

Summary

Setting LoggingConfig.log_exceptions to "always" is good to get more data about uncaught exceptions in a debug=False environment but can get pretty noisy, since we'll also log some common errors for schema validation, auth, etc when the developer might really only be interested in uncaught internal server errors.

It would be helpful if we could configure this according to HTTP status codes (or perhaps Union[int, type[Exception]] - similar to the keys of ExceptionHandlersMap?) and only log when raising for these status codes/types

Basic Example

Something like
LoggingConfig(exceptions={422, 500, MyCustomException})

Drawbacks and Impact

N/A

Unresolved questions

No response


Note

While we are open for sponsoring on GitHub Sponsors and
OpenCollective, we also utilize Polar.sh to engage in pledge-based sponsorship.

Check out all issues funded or available for funding on our Polar.sh dashboard

  • If you would like to see an issue prioritized, make a pledge towards it!
  • We receive the pledge once the issue is completed & verified
  • This, along with engagement in the community, helps us know which features are a priority to our users.
Fund with Polar
@LonelyVikingMichael LonelyVikingMichael added the Enhancement This is a new feature or request label Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement This is a new feature or request
Projects
None yet
Development

No branches or pull requests

1 participant