File tree 3 files changed +35
-2
lines changed
3 files changed +35
-2
lines changed Original file line number Diff line number Diff line change 1
1
1.7.11 (unreleased)
2
2
-------------------
3
3
4
- - Nothing changed yet.
4
+ - updates for sentry [amleczko]
5
5
6
6
7
7
1.7.10 (2013-05-21)
Original file line number Diff line number Diff line change
1
+ from raven .middleware import Sentry
2
+ from raven .base import Client
3
+ from raven .utils .wsgi import get_current_url , get_headers , get_environ
4
+
5
+
6
+ class PenelopeSentry (Sentry ):
7
+
8
+ def cleanup_headers (self , headers ):
9
+ if 'Cookie' in headers :
10
+ del headers ['Cookie' ]
11
+ return headers
12
+
13
+ def handle_exception (self , environ ):
14
+ event_id = self .client .captureException (
15
+ data = {
16
+ 'sentry.interfaces.Http' : {
17
+ 'method' : environ .get ('REQUEST_METHOD' ),
18
+ 'url' : get_current_url (environ , strip_querystring = True ),
19
+ 'query_string' : environ .get ('QUERY_STRING' ),
20
+ 'headers' : self .cleanup_headers (dict (get_headers (environ ))),
21
+ 'env' : dict (get_environ (environ )),
22
+ }
23
+ },
24
+ )
25
+ return event_id
26
+
27
+
28
+ def sentry_filter_factory (app , global_conf , ** kwargs ):
29
+ client = Client (** kwargs )
30
+ return PenelopeSentry (app , client )
Original file line number Diff line number Diff line change 53
53
'Beaker' ,
54
54
'js.jquery_datatables==1.8.2' ,
55
55
'unittest2' ,
56
- 'bleach'
56
+ 'bleach' ,
57
+ 'raven'
57
58
]
58
59
59
60
if sys .version_info [:3 ] < (2 ,5 ,0 ):
80
81
entry_points = """\
81
82
[paste.app_factory]
82
83
main = por.dashboard:main
84
+ [paste.filter_app_factory]
85
+ raven = por.dashboard.ravenlog:sentry_filter_factory
83
86
[fanstatic.libraries]
84
87
por = por.dashboard.fanstatic_resources:por_library
85
88
deform_library = por.dashboard.fanstatic_resources:deform_library
You can’t perform that action at this time.
0 commit comments