我试图让Celery记录到文件中。 我的log_config.yaml是:
version: 1
formatters:
default:
format: '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
loggers:
sqlalchemy:
level: CRITICAL
handlers: [debug_handler]
pepko.app:
level: INFO
handlers: [debug_handler]
celery:
handlers: [debug_handler]
level: DEBUG
handlers:
debug_handler:
class: logging.handlers.RotatingFileHandler
formatter: default
filename: pepkologs.log
backupCount: 2
level: DEBUG
root:
level: DEBUG
handlers: [debug_handler]
我有
flask_app.config['CELERYD_HIJACK_ROOT_LOGGER'] = True
但芹菜还在写
[2017-09-22 11:45:08,800: DEBUG/MainProcess] | Worker: Starting Beat
[2017-09-22 11:45:08,802: DEBUG/MainProcess] ^-- substep ok
[2017-09-22 11:45:08,805: DEBUG/MainProcess] | Worker: Starting Hub
[2017-09-22 11:45:08,808: DEBUG/MainProcess] ^-- substep ok
和终端的另一个东西。我做错了什么?