This is my temporary dev logging configuration:
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'verbose': {
'format': '[{asctime}] {levelname} {name} {message}',
'style': '{',
},
},
'handlers': {
'mail_admins': {
'level': 'ERROR',
'class': 'django.utils.log.AdminEmailHandler',
'include_html': True,
},
'console': {
'class': 'logging.StreamHandler',
'formatter': 'verbose',
},
},
'root': {
'handlers': ['mail_admins', 'console'],
'level': 'DEBUG',
'propagate': True
}
}
my mail_admins handler didn’t work on a staging server so im trying to troubleshoot what’s going on here. My main question is: how do i debug this? when stepping through e.g. log.error() i’m not seeing where the handlers for the loggers are being run. When i overrode the AdminEmailHandler class and put breakpoint in the send_mail and emit functions, they weren’t even reached.
If you have any tips whatsoever, ill be thankful for them