Skip to content

Commit 1c486d7

Browse files
authored
Include HTTP verb and URL in retry logs (Azure#23239)
For each try, include the HTTP verb and URL in the log message so it's clear which operation is being retried.
1 parent e351c53 commit 1c486d7

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

sdk/azcore/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
### Other Changes
1212

13+
* Include the HTTP verb and URL in `log.EventRetryPolicy` log entries so it's clear which operation is being retried.
14+
1315
## 1.13.0 (2024-07-16)
1416

1517
### Features Added

sdk/azcore/runtime/policy_retry.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ func (p *retryPolicy) Do(req *policy.Request) (resp *http.Response, err error) {
102102
try := int32(1)
103103
for {
104104
resp = nil // reset
105-
log.Writef(log.EventRetryPolicy, "=====> Try=%d", try)
105+
// unfortunately we don't have access to the custom allow-list of query params, so we'll redact everything but the default allowed QPs
106+
log.Writef(log.EventRetryPolicy, "=====> Try=%d for %s %s", try, req.Raw().Method, getSanitizedURL(*req.Raw().URL, getAllowedQueryParams(nil)))
106107

107108
// For each try, seek to the beginning of the Body stream. We do this even for the 1st try because
108109
// the stream may not be at offset 0 when we first get it and we want the same behavior for the

0 commit comments

Comments
 (0)