In the settings file I have a logger set up to send any errors to ADMINS which is the default behavior. Here:
LOGGING = {
'handlers': {'level': 'ERROR', 'class': 'django.utils.log.AdminEmailHandler'}
'loggers': {'django.request': {'handlers': ['mail_admins'], 'propagate': True}}
}
But I would like to set up a second logger to log a different type of errors and email should be sent to a different address.
I have my own logging function which writes to a file. Basically I want to send an email to that other address instead. How can I do this?
I don't know if it will work or not. You probably may want to override Django '
AdminEmailHandler' class.Try overriding like this
And change your logging to
This should send mails to the mail ids that are mentioned in
EXTRA_PEOPLEin project settings