Skip to content

Cron fails to log, while calling the function in django's shell works #31

Description

@washougal

I have a tasks.py file that's located in project/app/tasks.py that uses the standard logger:

import logging
logger = logging.getLogger(__name__)

The logging file is configured with loggers for all of the following:
django, app, django_crontab, django_crontab.crontab, crontab, and ''

When is open the shell and run the function, the logging appears:

python manage.py shell
import django
django.setup()
from app.tasks import my_scheduled_task()
my_scheduled_task()

Yet, when I add the cron job using python manage.py crontab add everything works (I can see the end result appear), yet nothing gets logged. Any reason why logging should work using the shell, but not as a cron?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions