Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

frustrating Django Logging #4326

Closed
blodone opened this issue Oct 12, 2017 · 1 comment

Comments

@blodone
Copy link

commented Oct 12, 2017

Hi,

Celery Logging with a standard django logging setup is very frustrating.
i have a standard setup like

import logging
logger = logging.getLogger(__name__)
logger.error('test celery logging')

and the

setting CELERYD_HIJACK_ROOT_LOGGER to False does not work like expected.
all output from logging logs to syslog.

Also my root logger ('') uses file and sentry logging so i would expect it logs to file and sentry by default.

perhaps it complicates with the django LOGGING attribute 'disable_existing_loggers' or other defined loggers.

i had to include

@signals.setup_logging.connect
def setup_logging(**kwargs):
    """Setup logging."""
    pass

in the config so my defined logging handlers work.
It would be nice to debug logging e.g. print the configured loggers at startup or provide more logging configuration in the docs or explain more in detail what has to be done to enable the correct logging path.

@lexabug

This comment has been minimized.

Copy link

commented Dec 26, 2017

If you use Celery v4.1.0 try CELERY_WORKER_HIJACK_ROOT_LOGGER instead of CELERY_CELERYD_HIJACK_ROOT_LOGGER in your django config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.