I am sure that this can only be done if I create my own class of tasks, but I would like to know if anyone else has found a way to do this.
The answer is yes, and it is quite easy.
http://docs.celeryproject.org/en/latest/userguide/tasks.html#abstract-classes
To expand on the accepted answer, here is a complete solution (works for Celery 4+ ):
4+
import celery from celery.task import task class MyBaseClassForTask(celery.Task): def on_failure(self, exc, task_id, args, kwargs, einfo): # exc (Exception) - The exception raised by the task. # args (Tuple) - Original arguments for the task that failed. # kwargs (Dict) - Original keyword arguments for the task that failed. print('{0!r} failed: {1!r}'.format(task_id, exc)) @task(name="foo:my_task", base=MyBaseClassForTask) def add(x, y): raise KeyError()
Resources