1

The standard Django logging setup doesn't catch logging of exceptions in a Huey task.

This means that important tasks fail silently by default.

How can I make sure the exceptions are logged?

seddonym
  • 16,304
  • 6
  • 66
  • 71

1 Answers1

1

You need to add a huey logger to your settings.LOGGING. For example:

# settings.py

...

LOGGING = {
    ...
    'loggers': {
       ...
       'huey': {
         'handlers': ['error', 'mail_admins'],
         'level': 'ERROR',
         'propagate': False
       },
    },
    ...
}
seddonym
  • 16,304
  • 6
  • 66
  • 71
  • Why was this answer downvoted? I tried this but didn't work. Did you find a solution by any chance @seddonym? I asked a kinda-related question here: https://stackoverflow.com/q/60341868/1211429 – Joseph Victor Zammit Feb 21 '20 at 17:04