@app.task
def error_handler(task_id, task_name):
 logger = get_task_logger(__name__)
 result = app.AsyncResult(task_id)
 excep = result.get(propagate=False)
 logger.error('#####FAILURE LOG BEGIN#####\nTask {0} raised exception: {0}\n\\{0}\n#####FAILURE LOG STOP#####'.format(task_name, excep, result.traceback))

@ app . task def error_handler ( task_id , task_name ) : logger = get_task_logger ( __name__ ) result = app . AsyncResult ( task_id ) excep = result . get ( propagate = False ) logger . error ( '#####FAILURE LOG BEGIN#####\nTask {0} raised exception: {0}\n\\{0}\n#####FAILURE LOG STOP#####' . format ( task_name , excep , result . traceback ) )
logs detailed message about tasks that raise exceptions .