How to disable logging on the standard error stream?

I found a solution for this:

logger = logging.getLogger('my-logger')
logger.propagate = False
# now if you use logger it will not log to console.

This will prevent logging from being send to the upper logger that includes the console logging.

Leave a Comment