-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
fix: default logging #27777
fix: default logging #27777
Changes from all commits
ed26bf1
527aa05
1f808f3
22ae88f
34007cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,17 +41,7 @@ def configure_logging( | |
if app_config["SILENCE_FAB"]: | ||
logging.getLogger("flask_appbuilder").setLevel(logging.ERROR) | ||
|
||
# configure superset app logger | ||
superset_logger = logging.getLogger("superset") | ||
if debug_mode: | ||
superset_logger.setLevel(logging.DEBUG) | ||
else: | ||
# In production mode, add log handler to sys.stderr. | ||
superset_logger.addHandler(logging.StreamHandler()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm unclear on what this does ^^^, but if it does anything that's not the default behavior, removing this line could affect people's production env and is a breaking change There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See the PR description under "Cause of duplicate logging" - by default |
||
superset_logger.setLevel(logging.INFO) | ||
|
||
logging.getLogger("pyhive.presto").setLevel(logging.INFO) | ||
jessie-ross marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# basicConfig() will set up a default StreamHandler on stderr | ||
logging.basicConfig(format=app_config["LOG_FORMAT"]) | ||
logging.getLogger().setLevel(app_config["LOG_LEVEL"]) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have to admit I don't like this section that ties a bunch of behaviors to "debug_mode" potentially overriding
LOG_LEVEL
. It's like some configuration flags influence one another in a way that admins can't control.I feel this needs more thinking/refactoring.
One option would be to move the DEBUG/LOG_LEVEL entanglement into
superset/config.py
so people can see that dayLOG_LEVEL = logging.DEBUG if DEBUG else logging.INFO
and choose to override it in theirsuperset_config.py
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think that's a very good idea. It is technically a breaking change, but only for debug-level environments so should be acceptable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I can move this addition to a separate PR if it requires further discussion.)