diff --git a/cms/envs/common.py b/cms/envs/common.py index 3f8f4440c5..9d05a21d6a 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -121,6 +121,7 @@ MIDDLEWARE_CLASSES = ( ) ############################ SIGNAL HANDLERS ################################ +# This is imported to register the exception signal handling that logs exceptions import monitoring.exceptions # noqa ############################ DJANGO_BUILTINS ################################ diff --git a/common/djangoapps/util/middleware.py b/common/djangoapps/util/middleware.py deleted file mode 100644 index ce7b961766..0000000000 --- a/common/djangoapps/util/middleware.py +++ /dev/null @@ -1,16 +0,0 @@ -import logging - -from django.conf import settings -from django.http import HttpResponseServerError - -log = logging.getLogger("mitx") - - -class ExceptionLoggingMiddleware(object): - """Just here to log unchecked exceptions that go all the way up the Django - stack""" - - if not settings.TEMPLATE_DEBUG: - def process_exception(self, request, exception): - log.exception(exception) - return HttpResponseServerError("Server Error - Please try again later.") diff --git a/lms/envs/common.py b/lms/envs/common.py index bd77e711b3..33e9de4031 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -173,6 +173,9 @@ MODULESTORE = { } } +############################ SIGNAL HANDLERS ################################ +# This is imported to register the exception signal handling that logs exceptions +import monitoring.exceptions # noqa ############################### DJANGO BUILT-INS ############################### # Change DEBUG/TEMPLATE_DEBUG in your environment settings files, not here @@ -285,7 +288,6 @@ TEMPLATE_LOADERS = ( ) MIDDLEWARE_CLASSES = ( - 'util.middleware.ExceptionLoggingMiddleware', 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware',