Skip to content

Task logging #314

@cc-a

Description

@cc-a

Logging for tasks is primarily handled by the django-q logger. We've also added a wrapper for task functions to ensure that the any exceptions raised are also logged to the django logger. This is to exploit the Django AdminEmailHandler on the django logger.

This works well for unhandled exceptions in tasks but is a bit kludgy and it would be good for any error level log in tasks to generate an email to admins. Django Q2 does not document it's approach to logging well but this appears to be the relevant code. In short Django Q2 only does logger configuration if the django-q logger has not already been configured.

This issue covers:

  • Configuring the AdminEmailHandler for django-q in the production settings.
  • Removing the use of the log_task_exceptions_to_django_logger decorator.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions