[#111] Use request scope logger #136
No reviewers
TrueCloudLab/storage-services-developers
Labels
No labels
P0
P1
P2
P3
good first issue
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-s3-gw#136
Loading…
Reference in a new issue
No description provided.
Delete branch "dkirillov/frostfs-s3-gw:feature/111-improve_logs_by_adding_request_id"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Store child zap logger with request scope fields into context.
Request scoped fields: request_id, api/method, bucket, object
Signed-off-by: Denis Kirillov d.kirillov@yadro.com
close #111
5e163212f0
to9b9cf68602
WIP: [#111] Use request scope loggerto [#111] Use request scope logger@ -10,2 +10,4 @@
"sync"
"go.uber.org/zap"
redundant line
9b9cf68602
to73e3a55424
73e3a55424
to8470e0d8e4
@ -40,3 +48,3 @@
zap.Error(err)}
fields = append(fields, additional...)
h.log.Error("call method", fields...)
h.log.Error("reqeust failed", fields...) // consider using h.reqLogger (it requires accept context.Context or http.Request)
Any reasons to not using
h.reqLogger
in this PR besides amount of refactoring?No
@ -146,0 +164,4 @@
}
}
var objectMethods = []string{
This looks quite similar to
RequestTypeFromAPI()
. Maybe we can generalize it somehow later.8470e0d8e4
to2cb8050703
2cb8050703
to23593eee3d