handler = logging.handlers.RotatingFileHandler(LOG_FILENAME, maxBytes=20,
    backupCount=5)
handler.setLevel(logging.CRITICAL)
my_logger.addHandler(handler)
How to I disable and re-enable console logging in Python?