Enhancement: allow finer tuning LoggingConfig
for exception logging
#3455
Labels
Enhancement
This is a new feature or request
LoggingConfig
for exception logging
#3455
Summary
Setting
LoggingConfig.log_exceptions
to"always"
is good to get more data about uncaught exceptions in adebug=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 ofExceptionHandlersMap
?) and only log when raising for these status codes/typesBasic 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
The text was updated successfully, but these errors were encountered: