my_formatter = logging.Formatter(
    '%(asctime)s - %(name)s - %(levelname)s - %(message)s')
my_handler.setFormatter(my_formatter)
logger.addHandler(my_handler)
logging.info('My log handler connected -> Global Logging')
if __name__ == '__main__':
    app.start()
How to programmatically tell Celery to send all log messages to stdout or stderr?