Skip to content

Commit

Permalink
Add Response Status Number in http trace logs.
Browse files Browse the repository at this point in the history
Signed-off-by: Rishikesh1159 <[email protected]>
  • Loading branch information
Rishikesh1159 committed Jan 8, 2025
1 parent e7e19f7 commit 2f87a9b
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 2f87a9b

Please sign in to comment.