Skip to content

Commit b3390b9

Browse files
committed
add request id to the log
1 parent 567211d commit b3390b9

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

source/s3_meta_request.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1689,12 +1689,15 @@ void aws_s3_meta_request_send_request_finish_default(
16891689
} else {
16901690
AWS_LOGF_ERROR(
16911691
AWS_LS_S3_META_REQUEST,
1692-
"id=%p Meta request cannot recover from error %d (%s). (request=%p, response status=%d)",
1692+
"id=%p Meta request cannot recover from error %d (%s). (request=%p, response status=%d, "
1693+
"x-amz-request-id: %s, x-amz-id-2: %s)",
16931694
(void *)meta_request,
16941695
error_code,
16951696
aws_error_str(error_code),
16961697
(void *)request,
1697-
response_status);
1698+
response_status,
1699+
request->send_data.request_id ? aws_string_c_str(request->send_data.request_id) : "N/A",
1700+
request->send_data.amz_id_2 ? aws_string_c_str(request->send_data.amz_id_2) : "N/A");
16981701
}
16991702

17001703
} else {
@@ -1710,13 +1713,16 @@ void aws_s3_meta_request_send_request_finish_default(
17101713
} else {
17111714
AWS_LOGF_ERROR(
17121715
AWS_LS_S3_META_REQUEST,
1713-
"id=%p Request failed from error %d (%s). (request=%p, response status=%d). Try to setup a "
1716+
"id=%p Request failed from error %d (%s). (request=%p, response status=%d, x-amz-request-id: %s, "
1717+
"x-amz-id-2: %s). Try to setup a "
17141718
"retry.",
17151719
(void *)meta_request,
17161720
error_code,
17171721
aws_error_str(error_code),
17181722
(void *)request,
1719-
response_status);
1723+
response_status,
1724+
request->send_data.request_id ? aws_string_c_str(request->send_data.request_id) : "N/A",
1725+
request->send_data.amz_id_2 ? aws_string_c_str(request->send_data.amz_id_2) : "N/A");
17201726
}
17211727

17221728
/* Otherwise, set this up for a retry if the meta request is active. */

0 commit comments

Comments
 (0)