Last active
April 7, 2025 04:11
-
-
Save daryltucker/e40c59a267ea75db12b1 to your computer and use it in GitHub Desktop.
Really disable logger logging in Flask
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I have my own logging setup and had a hard time disabling console output in Flask. | |
app.logger.disabled = True | |
log = logging.getLogger('werkzeug') | |
log.disabled = True | |
# New, 2022 Method: | |
logging.getLogger('werkzeug').disabled = True |
Thank you!
This worked perfectly for me.
pasted right below the instantiation line
app = Flask(name)
logging.getLogger('werkzeug').disabled = True
thanks a lot
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Really nice! I'm using Flask 2.2.3, it works.