Add request ID to HTTP debugging to make it easier to trace concurrent flows
This commit is contained in:
parent
c102bf28e3
commit
d1759fdfa9
1 changed files with 2 additions and 2 deletions
|
@ -188,7 +188,7 @@ func (t *Transport) RoundTrip(req *http.Request) (resp *http.Response, err error
|
||||||
if t.logHeader || t.logBody {
|
if t.logHeader || t.logBody {
|
||||||
buf, _ := httputil.DumpRequestOut(req, t.logBody)
|
buf, _ := httputil.DumpRequestOut(req, t.logBody)
|
||||||
Debug(nil, "%s", separatorReq)
|
Debug(nil, "%s", separatorReq)
|
||||||
Debug(nil, "%s", "HTTP REQUEST")
|
Debug(nil, "%s (req %p)", "HTTP REQUEST", req)
|
||||||
Debug(nil, "%s", string(buf))
|
Debug(nil, "%s", string(buf))
|
||||||
Debug(nil, "%s", separatorReq)
|
Debug(nil, "%s", separatorReq)
|
||||||
}
|
}
|
||||||
|
@ -197,7 +197,7 @@ func (t *Transport) RoundTrip(req *http.Request) (resp *http.Response, err error
|
||||||
// Log response
|
// Log response
|
||||||
if t.logHeader || t.logBody {
|
if t.logHeader || t.logBody {
|
||||||
Debug(nil, "%s", separatorResp)
|
Debug(nil, "%s", separatorResp)
|
||||||
Debug(nil, "%s", "HTTP RESPONSE")
|
Debug(nil, "%s (req %p)", "HTTP RESPONSE", req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
Debug(nil, "Error: %v", err)
|
Debug(nil, "Error: %v", err)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue