In my settings.py i have the following logging config. If there's an error i get an email from root@localhost. My problem is that i have several projects and want all error messages sent to the same email adress. But now its very annoying to identify on which site the error occured so i want to replace the senders email address from root@localhost to something like [email protected]. Is this possible or have i to create some virtual mailboxes?
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'mail_admins': {
'level': 'DEBUG',
'class': 'django.utils.log.AdminEmailHandler'
},
'logfile': {
'class': 'logging.handlers.WatchedFileHandler',
'filename': '/var/log/django/proj_name.log'
},
},
'loggers': {
'django.request': {
'handlers': ['mail_admins'],
'level': 'DEBUG',
'propagate': True,
},
'django': {
'handlers': ['logfile'],
'level': 'DEBUG',
'propagate': False,
},
}
}
mail_admins uses SERVER_EMAIL setting
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With