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

Log delivery failures as errors #681

Merged
merged 4 commits into from
Aug 18, 2021
Merged

Conversation

imjoehaines
Copy link
Contributor

@imjoehaines imjoehaines commented Aug 18, 2021

Goal

Currently we log exceptions in delivery as warnings, which is the same level that we log recoverable exceptions (e.g. exceptions in on_error callbacks). This makes it easy to miss log messages that mean delivery has totally failed as they are mixed in with other messages of the same level

This PR switches delivery failures to log at the error level so that they are more noticeable and to allow recoverable log messages to be suppressed without also suppressing unrecoverable errors

Testing

I've refactored the current logging tests to use a real Logger object, which is the first commit. Use this comparison for only the delivery log level changes

This should help to differentiate errors that prevent things
from being delivered from errors that we can continue from,
e.g. errors raised in middleware
@imjoehaines imjoehaines force-pushed the log-delivery-failures-as-errors branch from 8e5e455 to 693a666 Compare August 18, 2021 12:25
@imjoehaines imjoehaines marked this pull request as ready for review August 18, 2021 12:26
Copy link
Contributor

@kattrali kattrali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The switch to an actual Logger is a really nice improvement 👍

@imjoehaines imjoehaines merged commit 1bcfe6a into next Aug 18, 2021
@imjoehaines imjoehaines deleted the log-delivery-failures-as-errors branch August 18, 2021 17:00
@imjoehaines imjoehaines mentioned this pull request Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants