Commits

Ed Crewe  committed 091e8fc

modify GAE django logging fix

  • Participants
  • Parent commits 81140e3

Comments (0)

Files changed (1)

File gaepuv/main.py

 import django.core.handlers.wsgi
 import django.core.signals
 import django.db
-import django.dispatch.dispatcher
+import django.dispatch
+import logging
+
+def log_exception(*args, **kwargs):
+  logging.exception('Exception in request:')
 
 # Log errors.
-#django.dispatch.dispatcher.connect(
-#   log_exception, django.core.signals.got_request_exception)
+django.dispatch.Signal.connect(
+   django.core.signals.got_request_exception, log_exception)
 
 # Unregister the rollback event handler.
-django.dispatch.dispatcher.disconnect(
-django.db._rollback_on_exception,
-django.core.signals.got_request_exception)
+django.dispatch.Signal.disconnect(
+    django.core.signals.got_request_exception,
+    django.db._rollback_on_exception)
 
 def main():
   # Create a Django application for WSGI.