-
-
Notifications
You must be signed in to change notification settings - Fork 780
Closed
Description
There are several places Connexion logs errors, for example:
- When exceptions are handled in
problem_handler,http_exceptionorcommon_error_handlerin theExceptionMiddleware - When validation of the input/output data fails in
connexion.validators.json
Connexion does a great job of handling exceptions by retuning a problem details with the appropriate status code to the user.
Now it's pretty common for operation teams to monitor exceptions in the logs and trigger alarms.
And here comes the issue:
Operations want to be alerted about everything that results in 5xx status codes. That indicates that a situation couldn't be handled from a user perspective. Operations don't need to be alerted if the status code is 4xx. Because those cases are gracefully handled.
I'd propose to
- change
ExceptionMiddlewareto log toerrorif the resulting status code is5xxand towarningfor4xxand - remove the error log from
connexion.validators.jsonsince theBadRequestProblemraised is logged via the Exception middleware anyway.
I'm happy to contribute those changes. What do you think?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels