You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When in debug mode, we can add logs with levels higher than error/warning. This works:
current_app.logger.debug("this is a debug log")
However, when in "production" (DEBUG is False), Flask will not change the level of the root logger, see here. As a consequence, any log higher than .error or .warning will not propagate to the specific handlers, so no logging output.
To test this, setting app.logger.setLevel(logging.DEBUG) fixes current_app.logger.debug.
The Flask documentation suggests setting the logging level before app initialization using from logging.config import dictConfig.
The text was updated successfully, but these errors were encountered:
When in debug mode, we can add logs with levels higher than error/warning. This works:
However, when in "production" (
DEBUG
isFalse
), Flask will not change the level of the root logger, see here. As a consequence, any log higher than.error
or.warning
will not propagate to the specific handlers, so no logging output.To test this, setting
app.logger.setLevel(logging.DEBUG)
fixescurrent_app.logger.debug
.The Flask documentation suggests setting the logging level before app initialization using
from logging.config import dictConfig
.The text was updated successfully, but these errors were encountered: