Exemplo n.º 1
0
    def process_request(self, request):
        request.environ['HTTP_X_SERVICE_NAME'] = \
            self.service_name or request.host
        payload = {
            'request': self.environ_to_dict(request.environ),
        }

        self.notifier.info(context.get_admin_context().to_dict(),
                           'http.request', payload)
Exemplo n.º 2
0
    def process_request(self, request):
        request.environ['HTTP_X_SERVICE_NAME'] = \
            self.service_name or request.host
        payload = {
            'request': self.environ_to_dict(request.environ),
        }

        self.notifier.info(context.get_admin_context().to_dict(),
                           'http.request', payload)
Exemplo n.º 3
0
    def process_response(self, request, response, exception=None, traceback=None):
        payload = {"request": self.environ_to_dict(request.environ)}

        if response:
            payload["response"] = {"status": response.status, "headers": response.headers}

        if exception:
            payload["exception"] = {"value": repr(exception), "traceback": tb.format_tb(traceback)}

        self.notifier.info(context.get_admin_context().to_dict(), "http.response", payload)
Exemplo n.º 4
0
    def process_response(self, request, response,
                         exception=None, traceback=None):
        payload = {
            'request': self.environ_to_dict(request.environ),
        }

        if response:
            payload['response'] = {
                'status': response.status,
                'headers': response.headers,
            }

        if exception:
            payload['exception'] = {
                'value': repr(exception),
                'traceback': tb.format_tb(traceback)
            }

        self.notifier.info(context.get_admin_context().to_dict(),
                           'http.response', payload)
Exemplo n.º 5
0
    def process_response(self, request, response,
                         exception=None, traceback=None):
        payload = {
            'request': self.environ_to_dict(request.environ),
        }

        if response:
            payload['response'] = {
                'status': response.status,
                'headers': response.headers,
            }

        if exception:
            payload['exception'] = {
                'value': repr(exception),
                'traceback': tb.format_tb(traceback)
            }

        self.notifier.info(context.get_admin_context().to_dict(),
                           'http.response', payload)
Exemplo n.º 6
0
    def process_request(self, request):
        request.environ["HTTP_X_SERVICE_NAME"] = self.service_name or request.host
        payload = {"request": self.environ_to_dict(request.environ)}

        self.notifier.info(context.get_admin_context().to_dict(), "http.request", payload)