fnp
/
redakcja.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
b899f68
)
Attempt to add traceback logging
author
Łukasz Rekucki
<lrekucki@gmail.com>
Fri, 12 Mar 2010 22:27:35 +0000
(23:27 +0100)
committer
Łukasz Rekucki
<lrekucki@gmail.com>
Fri, 12 Mar 2010 22:27:35 +0000
(23:27 +0100)
apps/maintenancemode/middleware.py
patch
|
blob
|
history
diff --git
a/apps/maintenancemode/middleware.py
b/apps/maintenancemode/middleware.py
index
404b1a0
..
35346c8
100644
(file)
--- a/
apps/maintenancemode/middleware.py
+++ b/
apps/maintenancemode/middleware.py
@@
-8,7
+8,8
@@
defaults.handler503 = 'maintenancemode.views.defaults.temporary_unavailable'
defaults.__all__.append('handler503')
from maintenancemode.conf.settings import MAINTENANCE_MODE
defaults.__all__.append('handler503')
from maintenancemode.conf.settings import MAINTENANCE_MODE
-
+import traceback
+
class MaintenanceModeMiddleware(object):
def process_request(self, request):
# Allow access if middleware is not activated
class MaintenanceModeMiddleware(object):
def process_request(self, request):
# Allow access if middleware is not activated
@@
-28,4
+29,9
@@
class MaintenanceModeMiddleware(object):
resolver = urlresolvers.get_resolver(None)
callback, param_dict = resolver._resolve_special('503')
resolver = urlresolvers.get_resolver(None)
callback, param_dict = resolver._resolve_special('503')
- return callback(request, **param_dict)
\ No newline at end of file
+ return callback(request, **param_dict)
+
+ def process_exception(self, request, exception):
+ tb_text = traceback.format_exc()
+ url = request.build_absolute_uri()
+ request.META['wsgi.errors'].write(url + '\n' + str(tb_text) + '\n')