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

Remove logger.exception on expected exceptions #19

Closed
wants to merge 1 commit into from

Conversation

wolever
Copy link

@wolever wolever commented Feb 10, 2016

Currently logger.exception(…) is called on exceptions that are expected to happen (ex, 404 errors, or retries exceeded), and re-raised back into user code. This pollutes application logs and is generally unhelpful.

@openstack-gerrit
Copy link

Thank you for contributing to openstack/python-swiftclient!

openstack/python-swiftclient uses Gerrit for code review.

If you have never contributed to OpenStack before make sure you have read the
getting started documentation:
http://docs.openstack.org/infra/manual/developers.html#getting-started

Otherwise please visit
http://docs.openstack.org/infra/manual/developers.html#development-workflow
and follow the instructions there to upload your change to Gerrit.

@clayg
Copy link
Contributor

clayg commented Feb 10, 2016

yay process! After awhile the Gerrit thing gets easier - sometimes you don't even notice the infinite sadness. If you're super down on it you should tweet at ... idk some openstack community/process/foundation person - maybe @Thingee

FWIW, this probably wouldn't fly as-is anyway since (as stated in the launchpad bug for the issue [1]) it's basically a direct revert of the original attempt to improve debug logging [2] which was a fix for another bug that swiftclient wasn't logging enough [3]

  1. https://bugs.launchpad.net/bugs/1213179
  2. https://review.openstack.org/#/c/37336/
  3. https://bugs.launchpad.net/python-swiftclient/+bug/1202229

@wolever
Copy link
Author

wolever commented Feb 11, 2016

This is the point, then, where I throw in the towel.

My fix — logger.exception = logger.info — is good enough, and to be frank: the shits I have to give could be better spent on projects that aren't 32 open reviews * 19 days / review = 608 days behind on accepting patches.

@saaros
Copy link

saaros commented Apr 11, 2016

FWIW PGHoard also faced this issue, we worked around it by monkey patching swiftclient's exception logging: Aiven-Open/pghoard@ad1a91b

PGHoard is a PostgreSQL backup and recovery daemon which stores PostgreSQL's write-ahead-log segments in an object store archive. PostgreSQL may and will request non-existent segments from the archive so just in normal operation we'd get tons of unnecessary logs for 404s.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants