mirror of
https://github.com/minio/minio
synced 2024-11-05 17:34:01 +00:00
trace - log request body (#8917)
This commit is contained in:
parent
d7dc9aaf52
commit
c9116e6bd7
1 changed files with 4 additions and 4 deletions
|
@ -121,6 +121,10 @@ func Trace(f http.HandlerFunc, logBody bool, w http.ResponseWriter, r *http.Requ
|
|||
t.NodeName = host
|
||||
}
|
||||
|
||||
rw := logger.NewResponseWriter(w)
|
||||
rw.LogBody = logBody
|
||||
f(rw, r)
|
||||
|
||||
rq := trace.RequestInfo{
|
||||
Time: time.Now().UTC(),
|
||||
Method: r.Method,
|
||||
|
@ -130,10 +134,6 @@ func Trace(f http.HandlerFunc, logBody bool, w http.ResponseWriter, r *http.Requ
|
|||
Headers: reqHeaders,
|
||||
Body: reqBodyRecorder.Data(),
|
||||
}
|
||||
rw := logger.NewResponseWriter(w)
|
||||
rw.LogBody = logBody
|
||||
f(rw, r)
|
||||
|
||||
rs := trace.ResponseInfo{
|
||||
Time: time.Now().UTC(),
|
||||
Headers: rw.Header().Clone(),
|
||||
|
|
Loading…
Reference in a new issue