SunnyBoy-WYH commented on code in PR #2466: URL: https://github.com/apache/incubator-hugegraph/pull/2466#discussion_r1640672782
########## hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/api/filter/AccessLogFilter.java: ########## @@ -109,13 +113,25 @@ public void filter(ContainerRequestContext requestContext, // Record slow query if meet needs, watch out the perf if (timeThreshold > 0 && executeTime > timeThreshold && needRecordLog(requestContext)) { - // TODO: set RequestBody null, handle it later & should record "client IP" - LOG.info("[Slow Query] execTime={}ms, body={}, method={}, path={}, query={}", - executeTime, null, method, path, uri.getQuery()); + + LOG.info("[Slow Query] ip={} execTime={}ms, body={}, method={}, path={}, query={}", + getClientIP(requestContext), executeTime, + requestContext.getProperty(REQUEST_PARAMS_JSON), method, path, + uri.getQuery()); Review Comment: for GET , REQUEST_PARAMS_JSON will extract the `id` info from `/example/{id} `; uri.getQuery() will extract ` id=1` from `http://example.com/resource?id=1` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@hugegraph.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@hugegraph.apache.org For additional commands, e-mail: issues-h...@hugegraph.apache.org