Exemplo n.º 1
0
Arquivo: utils.py Projeto: a70/geonode
 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)
Exemplo n.º 2
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)
Exemplo n.º 3
0
Arquivo: utils.py Projeto: a70/geonode
    def emit(self, record):
        exc_info = record.exc_info
        req = record.request
        resp = record.response
        if not req._monitoring.get('processed'):
            try:
                re = RequestEvent.from_geonode(self.service, req, resp)
                req._monitoring['processed'] = re
            except BaseException:
                req._monitoring['processed'] = None
        re = req._monitoring.get('processed')

        if re and exc_info:
            tb = traceback.format_exception(*exc_info)
            ExceptionEvent.add_error(self.service, exc_info[1], tb, request=re)
Exemplo n.º 4
0
    def emit(self, record):
        exc_info = record.exc_info
        req = record.request
        resp = record.response
        if not req._monitoring.get('processed'):
            try:
                re = RequestEvent.from_geonode(self.service, req, resp)
                req._monitoring['processed'] = re
            except BaseException:
                req._monitoring['processed'] = None
        re = req._monitoring.get('processed')

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