Adding Email Notifications to ADMINS for Warning Logs or Above

This commit is contained in:
Gowtham Sai 2022-12-06 16:18:23 +05:30
parent d918735bf8
commit f41a0e85e9
1 changed files with 3 additions and 3 deletions

View File

@ -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'
} }
} }