forked from TrueCloudLab/frostfs-s3-gw
[#606] Support log tagging
Signed-off-by: Nikita Zinkevich <n.zinkevich@yadro.com>
This commit is contained in:
parent
ffac62e8b4
commit
e7f620f137
40 changed files with 850 additions and 497 deletions
|
@ -245,13 +245,14 @@ func errorResponseHandler(w http.ResponseWriter, r *http.Request) {
|
|||
zap.String("method", reqInfo.API),
|
||||
zap.String("http method", r.Method),
|
||||
zap.String("url", r.RequestURI),
|
||||
logs.TagField(logs.TagDatapath),
|
||||
}
|
||||
|
||||
if wrErr != nil {
|
||||
fields = append(fields, zap.NamedError("write_response_error", wrErr))
|
||||
}
|
||||
|
||||
log.Error(logs.RequestUnmatched, fields...)
|
||||
log.Error(logs.RequestUnmatched, append(fields, logs.TagField(logs.TagDatapath))...)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -266,13 +267,14 @@ func notSupportedHandler() http.HandlerFunc {
|
|||
fields := []zap.Field{
|
||||
zap.String("http method", r.Method),
|
||||
zap.String("url", r.RequestURI),
|
||||
logs.TagField(logs.TagDatapath),
|
||||
}
|
||||
|
||||
if wrErr != nil {
|
||||
fields = append(fields, zap.NamedError("write_response_error", wrErr))
|
||||
}
|
||||
|
||||
log.Error(logs.NotSupported, fields...)
|
||||
log.Error(logs.NotSupported, append(fields, logs.TagField(logs.TagDatapath))...)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue