Skip to content

Instantly share code, notes, and snippets.

@daryltucker

daryltucker/flask.py

Last active Mar 13, 2020
Embed
What would you like to do?
Really disable logger logging in Flask
# 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
@yurisbv

This comment has been minimized.

Copy link

@yurisbv yurisbv commented Feb 1, 2018

Nice!

@techdiverdown

This comment has been minimized.

Copy link

@techdiverdown techdiverdown commented Feb 13, 2018

Great, used this today. Thanks!

@BobDenny

This comment has been minimized.

Copy link

@BobDenny BobDenny commented Dec 1, 2018

What is 'cf'?

@tw7613781

This comment has been minimized.

Copy link

@tw7613781 tw7613781 commented Feb 25, 2019

What is 'cf'?

import logging
app.logger.disabled = True
log = logging.getLogger('werkzeug')
log.disabled = True
@Jonney

This comment has been minimized.

Copy link

@Jonney Jonney commented Feb 18, 2020

It dosn't work fo me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment