From 30be8638e08cee11b8e12232af02fd2197a270e6 Mon Sep 17 00:00:00 2001 From: Michael Elkins Date: Fri, 17 Jun 2016 18:46:35 +0000 Subject: Disable email to root when a Django exception occurs, and log it to the apache log instead. Make the GUI log level configurable via rpki.conf svn path=/branches/tk705/; revision=6444 --- rpki/django_settings/gui.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'rpki/django_settings/gui.py') diff --git a/rpki/django_settings/gui.py b/rpki/django_settings/gui.py index 926c7dee..6097a94f 100644 --- a/rpki/django_settings/gui.py +++ b/rpki/django_settings/gui.py @@ -37,9 +37,6 @@ STATIC_ROOT = rpki.autoconf.datarootdir + "/rpki/media" # Must end with a slash! STATIC_URL = "/media/" -# Where to email server errors. -ADMINS = (("Administrator", "root@localhost"),) - LOGGING = { "version": 1, "formatters": { @@ -54,18 +51,22 @@ LOGGING = { "level": "DEBUG", "formatter": "verbose", }, - "mail_admins": { - "level": "ERROR", - "class": "django.utils.log.AdminEmailHandler", - }, }, "loggers": { - "django": { - "level": "ERROR", - "handlers": ["stderr", "mail_admins"], + # override default behavior to avoid emailing, and send it to stderr + "django.request": { + "level": 'ERROR', + "handlers": ["stderr"], + "propagate": False, + }, + # override default behavior to avoid emailing, and send it to stderr + "django.security": { + "level": 'ERROR', + "handlers": ["stderr"], + "propagate": False, }, "rpki.gui": { - "level": "WARNING", + "level": cfg.get('log-level', 'WARNING', section='web_portal'), "handlers": ["stderr"], }, }, -- cgit v1.2.3