forked from TrueCloudLab/frostfs-s3-gw
[#25] Refactoring and make fixes
closes #25 closes #33 Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
This commit is contained in:
parent
4d605d1113
commit
256850b8fe
10 changed files with 125 additions and 64 deletions
|
@ -137,7 +137,13 @@ func logErrorResponse(l *zap.Logger) mux.MiddlewareFunc {
|
|||
if lw.statusCode >= http.StatusMultipleChoices {
|
||||
l.Error("something went wrong",
|
||||
zap.Int("status", lw.statusCode),
|
||||
zap.String("method", mux.CurrentRoute(r).GetName()))
|
||||
zap.String("method", mux.CurrentRoute(r).GetName()),
|
||||
zap.String("description", http.StatusText(lw.statusCode)))
|
||||
} else {
|
||||
l.Info("call method",
|
||||
zap.Int("status", lw.statusCode),
|
||||
zap.String("method", mux.CurrentRoute(r).GetName()),
|
||||
zap.String("description", http.StatusText(lw.statusCode)))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -162,7 +168,7 @@ func Attach(r *mux.Router, m MaxClients, h Handler, center *auth.Center, log *za
|
|||
setRequestID,
|
||||
|
||||
// -- logging error requests
|
||||
// logErrorResponse(log),
|
||||
logErrorResponse(log),
|
||||
)
|
||||
|
||||
// Attach user authentication for all S3 routes.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue