6

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 error@project-site.tld. 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,
        },
    }
}
4

1 回答 1

12

mail_admins uses SERVER_EMAIL setting

于 2013-01-25T00:02:58.470 回答