Skip to content

Error Logging #1925

@alfechner

Description

@alfechner

There are several places Connexion logs errors, for example:

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

  1. change ExceptionMiddleware to log to error if the resulting status code is 5xx and to warning for 4xx and
  2. remove the error log from connexion.validators.json since the BadRequestProblem raised is logged via the Exception middleware anyway.

I'm happy to contribute those changes. What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions