I'm still new to Python and Celery. I've setup Celery app to send all logs to Google Cloud Logging.
It seems that part of the logs are sent as DEBUG, but some as INFO, causing me so much strain when trying to read them...
Example logging handler
LOGGING_GCP = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'standard': {
'class': 'logging.Formatter',
'format': '%(message)s | %(module)s:%(lineno)d',
},
},
'handlers': {
'gcp': {
'level': 'DEBUG',
'class': 'google.cloud.logging.handlers.ContainerEngineHandler',
'formatter': 'standard',
},
},
'loggers': {
'': {
'handlers': ['gcp'],
'level': 'DEBUG',
'propagate': 'False',
}
}
}
Celery is started with --loglevel DEBUG
.
Scheduler config
CELERYD_HIJACK_ROOT_LOGGER=False,
CELERYD_REDIRECT_STDOUTS=False,
If I check logs I below as DEBUG:
"tasks.someTaskName sent. id->26108d79-46cd-41dc-a074-925fc2dedff8"
"Task accepted: tasks.someTaskName[6781cc58-d158-45dd-a9a8-5b6c26239a79] pid:8"
"beat: Waking up now."
While these are printed as INFO:
"Received task: tasks.someTaskName[59955295-2dc1-4667-b163-2c4181658dd3] "
"Scheduler: Sending due task someTaskName (tasks.someTaskName)"
"Task tasks.someTaskName[6781cc58-d158-45dd-a9a8-5b6c26239a79] succeeded in 0.0221633310002s: None"
I'd like INFO tasks to be printed as DEBUG so that my actual application INFO logs are clearly separated.