diff --git a/vcsserver/tweens/request_wrapper.py b/vcsserver/tweens/request_wrapper.py --- a/vcsserver/tweens/request_wrapper.py +++ b/vcsserver/tweens/request_wrapper.py @@ -53,20 +53,20 @@ class RequestWrapperTween(object): _path = safe_str(get_access_path(request.environ)) ip = '127.0.0.1' 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( 'Req[%4s] IP: %s %s Request to %s time: %.4fs [%s], VCSServer %s', count, ip, request.environ.get('REQUEST_METHOD'), _path, total, get_user_agent(request.environ), _ver_, - extra={"time": total, "ver": _ver_, + extra={"time": total, "ver": _ver_, "code": resp_code, "path": _path, "view_name": match_route} ) statsd = request.registry.statsd if statsd: match_route = request.matched_route.name if request.matched_route else _path - resp_code = getattr(response, 'status_code', 'UNDEFINED') elapsed_time_ms = round(1000.0 * total) # use ms only statsd.timing( "vcsserver_req_timing.histogram", elapsed_time_ms,