[#369] Modify http logging #441

Merged
nzinkevich merged 2 commits from nzinkevich/frostfs-s3-gw:feature/log_response into feature/369 2024-09-04 19:51:14 +00:00
Showing only changes of commit 3bd8a9d724 - Show all commits

View file

@ -4,6 +4,7 @@ package middleware
import (
"bytes"
"encoding/base64"
"fmt"
"io"
"net/http"
@ -156,7 +157,7 @@ func withBody(httplog *zap.Logger, r *http.Request) (*zap.Logger, error) {
defer r.Body.Close()
r.Body = io.NopCloser(bytes.NewBuffer(body))
httplog = httplog.With(zap.String("body", string(body)))
httplog = httplog.With(zap.String("body", base64.StdEncoding.EncodeToString(body)))
return httplog, nil
}