Skip to content

Commit

Permalink
Add Response Status Number in http trace logs. (#16978) (#16986)
Browse files Browse the repository at this point in the history
(cherry picked from commit 2c7d774)

Signed-off-by: Rishikesh1159 <rishireddy1159@gmail.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent afb2f94 commit 486f392
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/src/main/java/org/opensearch/http/HttpTracer.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,11 @@ void traceResponse(
) {
logger.trace(
new ParameterizedMessage(
"[{}][{}][{}][{}][{}] sent response to [{}] success [{}]",
"[{}][{}][{}][{}][{}][{}] sent response to [{}] success [{}]",
requestId,
opaqueHeader,
restResponse.status(),
restResponse.status().getStatus(),
restResponse.contentType(),
contentLength,
httpChannel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,8 @@ public HttpStats stats() {
+ opaqueId
+ "\\]\\["
+ (badRequest ? "BAD_REQUEST" : "OK")
+ "\\]\\["
+ (badRequest ? "400" : "200")
+ "\\]\\[null\\]\\[0\\] sent response to \\[.*"
)
);
Expand Down

0 comments on commit 486f392

Please sign in to comment.