From 3628bc36d0d177cae76544bb40cb69ef78ce667f Mon Sep 17 00:00:00 2001 From: Sarah Withee <2601974+geekygirlsarah@users.noreply.github.com> Date: Mon, 9 Oct 2023 19:28:27 -0400 Subject: [PATCH] Add admin email handler --- codethesaurus/settings.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/codethesaurus/settings.py b/codethesaurus/settings.py index ac79008c1..8f51b5356 100644 --- a/codethesaurus/settings.py +++ b/codethesaurus/settings.py @@ -158,5 +158,17 @@ EMAIL_PORT = os.getenv('EMAIL_PORT', '') EMAIL_USE_TLS = os.getenv('EMAIL_USE_TLS', '') +LOGGING = { + "version": 1, # the dictConfig format version + "disable_existing_loggers": False, # retain the default loggers + "handlers": { + "mail_admins": { + "level": "ERROR", + "class": "django.utils.log.AdminEmailHandler", + "include_html": True, + }, + } +} + # Configure Django App for Heroku. django_on_heroku.settings(locals(), test_runner=False, databases=False, staticfiles=True, logging=True)