Skip to content

added option to limit logging by level in Flask #344

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

Closed
wants to merge 6 commits into from

Conversation

beniwohli
Copy link
Contributor

@beniwohli beniwohli commented Nov 23, 2018

fixes #342
fixes #343

@@ -143,6 +143,18 @@ from elasticapm.contrib.flask import ElasticAPM
apm = ElasticAPM(app, logging=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

logging=True seems like a footgun. I'd rather lead with the explanation of logging=logging.ERROR and then mention that you can do logging=True to get everything incl. the nice warning that you currently have below the logging=logging.ERROR example.

It's also worth considering to completely stop mentioning logging=True. Setting logging=logging.DEBUG has the same effect and is more obviously a footgun.

Copy link
Contributor Author

@beniwohli beniwohli Nov 23, 2018

Choose a reason for hiding this comment

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

That makes the docs ten times better! 👍

Copy link
Contributor

@roncohen roncohen left a comment

Choose a reason for hiding this comment

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

LGTM besides a tiny docs nit pick 👍

@beniwohli
Copy link
Contributor Author

Looks like adding logging=xyz has some side effects, not sure which. I hoped that removing the installed handler in the fixture tear down would be enough, but that doesn't seem to be the case :(

@beniwohli
Copy link
Contributor Author

merged in e05afc4

@beniwohli beniwohli closed this Jan 4, 2019
@beniwohli beniwohli deleted the fix-setup-logging branch January 4, 2019 09:37
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.

[Flask] Add option to set up logging by log level [Flask] logging=True can be extremely noisy, needs to be documented
3 participants