diff --git a/rhodecode/lib/middleware/request_wrapper.py b/rhodecode/lib/middleware/request_wrapper.py --- a/rhodecode/lib/middleware/request_wrapper.py +++ b/rhodecode/lib/middleware/request_wrapper.py @@ -56,6 +56,7 @@ class RequestWrapperTween(object): _auth_user = self._get_user_info(request) ip = get_ip_addr(request.environ) match_route = request.matched_route.name if request.matched_route else "NOT_FOUND" + resp_code = getattr(response, 'status_code', 'UNDEFINED') total = time.time() - start log.info( @@ -63,12 +64,11 @@ class RequestWrapperTween(object): count, _auth_user, request.environ.get('REQUEST_METHOD'), _path, total, get_user_agent(request. environ), _ver_, extra={"time": total, "ver": _ver_, "ip": ip, - "path": _path, "view_name": match_route} + "path": _path, "view_name": match_route, "code": resp_code} ) statsd = request.registry.statsd if statsd: - resp_code = getattr(response, 'status_code', 'UNDEFINED') elapsed_time_ms = round(1000.0 * total) # use ms only statsd.timing( "rhodecode_req_timing.histogram", elapsed_time_ms,