Commit 6f2f08fb by Bridger Maxwell

Merged in bug fixes from default

--HG--
branch : profiledev
parents 9ba59fe3 6fa632c0
...@@ -135,6 +135,9 @@ execfile(os.path.join(BASE_DIR, "settings.py")) ...@@ -135,6 +135,9 @@ execfile(os.path.join(BASE_DIR, "settings.py"))
# the site admins on every HTTP 500 error. # the site admins on every HTTP 500 error.
# See http://docs.djangoproject.com/en/dev/topics/logging for # See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration. # more details on how to customize your logging configuration.
pid = os.getpid()
LOGGING = { LOGGING = {
'version': 1, 'version': 1,
'disable_existing_loggers': True, 'disable_existing_loggers': True,
...@@ -163,23 +166,21 @@ LOGGING = { ...@@ -163,23 +166,21 @@ LOGGING = {
'level' : 'DEBUG' if DEBUG else 'INFO', 'level' : 'DEBUG' if DEBUG else 'INFO',
'class' : 'logging.handlers.WatchedFileHandler', 'class' : 'logging.handlers.WatchedFileHandler',
'formatter' : 'standard', 'formatter' : 'standard',
'filename' : LOG_DIR + '/mitx.log', # temporary location for proof of concept 'filename' : '{0}/mitx.{1}.log'.format(LOG_DIR, pid),
'encoding' : 'utf-8', 'encoding' : 'utf-8',
}, },
'app_err' : { 'app_err' : {
'level' : 'WARNING', 'level' : 'WARNING',
'class' : 'logging.handlers.WatchedFileHandler', 'class' : 'logging.handlers.WatchedFileHandler',
'formatter' : 'standard', 'formatter' : 'standard',
'filename' : LOG_DIR + '/mitx.err.log', # temporary location for proof of concept 'filename' : '{0}/mitx.err.{1}.log'.format(LOG_DIR, pid),
'encoding' : 'utf-8', 'encoding' : 'utf-8',
}, },
# We should actually use this for tracking:
# http://pypi.python.org/pypi/ConcurrentLogHandler/0.8.2
'tracking' : { 'tracking' : {
'level' : 'INFO', 'level' : 'INFO',
'class' : 'logging.handlers.WatchedFileHandler', 'class' : 'logging.handlers.WatchedFileHandler',
'formatter' : 'raw', 'formatter' : 'raw',
'filename' : LOG_DIR + '/tracking.log', 'filename' : '{0}/tracking.{1}.log'.format(LOG_DIR, pid),
'encoding' : 'utf-8', 'encoding' : 'utf-8',
}, },
'mail_admins' : { 'mail_admins' : {
......
ASKBOT_ENABLED = False
execfile("settings_old_askbot.py")
COURSEWARE_ENABLED = False
execfile("settings.py")
import logging import logging
from django.conf import settings
from django.http import HttpResponse from django.http import HttpResponse
log = logging.getLogger("mitx") log = logging.getLogger("mitx")
...@@ -8,6 +9,7 @@ class ExceptionLoggingMiddleware(object): ...@@ -8,6 +9,7 @@ class ExceptionLoggingMiddleware(object):
"""Just here to log unchecked exceptions that go all the way up the Django """Just here to log unchecked exceptions that go all the way up the Django
stack""" stack"""
if not settings.TEMPLATE_DEBUG:
def process_exception(self, request, exception): def process_exception(self, request, exception):
log.exception(exception) log.exception(exception)
return HttpResponse("Server Error - Please try again later.") return HttpResponse("Server Error - Please try again later.")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment