Adding Email Notifications to ADMINS for Warning Logs or Above
This commit is contained in:
parent
d918735bf8
commit
f41a0e85e9
|
@ -30,6 +30,7 @@ DEBUG = os.environ.get('DEBUG') == "True"
|
||||||
|
|
||||||
ALLOWED_HOSTS = ['cdc.iitdh.ac.in', 'localhost']
|
ALLOWED_HOSTS = ['cdc.iitdh.ac.in', 'localhost']
|
||||||
|
|
||||||
|
ADMINS = [('Gowtham Sai', '190010036@iitdh.ac.in'), ('Karthik Mv', '200010030@iitdh.ac.in')]
|
||||||
# Application definition
|
# Application definition
|
||||||
|
|
||||||
INSTALLED_APPS = [
|
INSTALLED_APPS = [
|
||||||
|
@ -185,14 +186,13 @@ LOGGING = {
|
||||||
'class': 'django_db_logger.db_log_handler.DatabaseLogHandler'
|
'class': 'django_db_logger.db_log_handler.DatabaseLogHandler'
|
||||||
},
|
},
|
||||||
'mail_admins': {
|
'mail_admins': {
|
||||||
'level': 'ERROR',
|
'level': 'WARNING',
|
||||||
'class': 'django.utils.log.AdminEmailHandler',
|
'class': 'django.utils.log.AdminEmailHandler',
|
||||||
'include_html': True,
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'loggers': {
|
'loggers': {
|
||||||
'db': {
|
'db': {
|
||||||
'handlers': ['db_log'],
|
'handlers': ['db_log', 'mail_admins'],
|
||||||
'level': 'DEBUG'
|
'level': 'DEBUG'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue