Beispiel #1
0
 def run(self):
     q = RequestToMonitoringThread.q
     while True:
         if not q.empty():
             item = q.get()
             req, resp = item
             RequestEvent.from_geonode(self.service, req, resp)
Beispiel #2
0
    def emit(self, record):
        exc_info = record.exc_info
        req = record.request
        resp = record.response
        if not req._monitoring.get('processed'):
            re = RequestEvent.from_geonode(self.service, req, resp)
            req._monitoring['processed'] = re
        re = req._monitoring.get('processed')

        if exc_info:
            tb = traceback.format_exception(*exc_info)
            ExceptionEvent.add_error(self.service, exc_info[1], tb, request=re)