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 expected exceptions triggering retries at non-error level #708

Closed
ashleyheath opened this issue Dec 5, 2022 · 2 comments · Fixed by #845
Closed

Log expected exceptions triggering retries at non-error level #708

ashleyheath opened this issue Dec 5, 2022 · 2 comments · Fixed by #845

Comments

@ashleyheath
Copy link
Contributor

I would like to have INFO level logging switched on for Procrastinate's worker.py in order to see the start/stop points for the worker itself, along with any errors and warnings about misconfiguration, etc..

However, worker.py currently logs all unhanded exceptions from a task at ERROR, which results in error-level logging for expected exceptions. This is not desirable where the procrastinate task is being used to make use of the retry mechanism e.g. to repeatedly attempt a call to a remote API that can fail intermittently. In this context., I only want the final exception to be logged as an error (as now that there will be no more retry attempts, it's truly a problem). Prior to that, if the retry strategy is triggered, I believe INFO would be more appropriate.

Would you be open to this change being made? (Am happy to put a PR together).

@ewjoachim
Copy link
Member

This seems appropriate (as long as one logs is still is "error"). Happy to review a PR :)

@ashleyheath
Copy link
Contributor Author

@ewjoachim, got round to it eventually 😅 - #845 for you to review at your convenience. Thanks!

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 a pull request may close this issue.

2 participants