forked from TrueCloudLab/frostfs-s3-gw
[#606] Reorganize some log tags
Signed-off-by: Alex Vanin <a.vanin@yadro.com>
This commit is contained in:
parent
b207eb48d9
commit
ee46382a68
6 changed files with 30 additions and 29 deletions
2
api/cache/listsession.go
vendored
2
api/cache/listsession.go
vendored
|
@ -52,7 +52,7 @@ func NewListSessionCache(config *Config) *ListSessionCache {
|
|||
session, ok := val.(*data.ListSession)
|
||||
if !ok {
|
||||
config.Logger.Warn(logs.InvalidCacheEntryType, zap.String("actual", fmt.Sprintf("%T", val)),
|
||||
zap.String("expected", fmt.Sprintf("%T", session)))
|
||||
zap.String("expected", fmt.Sprintf("%T", session)), logs.TagField(logs.TagDatapath))
|
||||
}
|
||||
|
||||
if !session.Acquired.Load() {
|
||||
|
|
|
@ -108,13 +108,13 @@ func (h *handler) AppendCORSHeaders(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
bktInfo, err := h.getBucketInfo(ctx, reqInfo.BucketName)
|
||||
if err != nil {
|
||||
h.reqLogger(ctx).Warn(logs.GetBucketInfo, zap.Error(err), logs.TagField(logs.TagExternalBlockchain))
|
||||
h.reqLogger(ctx).Warn(logs.GetBucketInfo, zap.Error(err), logs.TagField(logs.TagDatapath))
|
||||
return
|
||||
}
|
||||
|
||||
cors, err := h.obj.GetBucketCORS(ctx, bktInfo, h.cfg.NewXMLDecoder)
|
||||
if err != nil {
|
||||
h.reqLogger(ctx).Warn(logs.GetBucketCors, zap.Error(err), logs.TagField(logs.TagExternalStorageTree))
|
||||
h.reqLogger(ctx).Warn(logs.GetBucketCors, zap.Error(err), logs.TagField(logs.TagDatapath))
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -853,7 +853,7 @@ func (n *Layer) ResolveBucket(ctx context.Context, zone, name string) (cid.ID, e
|
|||
return cid.ID{}, err
|
||||
}
|
||||
|
||||
n.reqLogger(ctx).Info(logs.ResolveBucket, zap.Stringer("cid", cnrID), logs.TagField(logs.TagExternalBlockchain))
|
||||
n.reqLogger(ctx).Info(logs.ResolveBucket, zap.Stringer("cid", cnrID), logs.TagField(logs.TagDatapath))
|
||||
}
|
||||
|
||||
return cnrID, nil
|
||||
|
@ -878,7 +878,7 @@ func (n *Layer) DeleteBucket(ctx context.Context, p *DeleteBucketParams) error {
|
|||
|
||||
corsObj, err := n.treeService.GetBucketCORS(ctx, p.BktInfo)
|
||||
if err != nil {
|
||||
n.reqLogger(ctx).Error(logs.GetBucketCors, zap.Error(err), logs.TagField(logs.TagExternalStorageTree))
|
||||
n.reqLogger(ctx).Error(logs.GetBucketCorsFromTree, zap.Error(err), logs.TagField(logs.TagExternalStorageTree))
|
||||
}
|
||||
|
||||
lifecycleObj, treeErr := n.treeService.GetBucketLifecycleConfiguration(ctx, p.BktInfo)
|
||||
|
|
|
@ -548,7 +548,7 @@ func (n *Layer) objectPutAndHash(ctx context.Context, prm frostfs.PrmObjectCreat
|
|||
func (n *Layer) payloadDiscard(ctx context.Context, payload io.Reader) {
|
||||
if payload != nil {
|
||||
if _, errDiscard := io.Copy(io.Discard, payload); errDiscard != nil {
|
||||
n.reqLogger(ctx).Warn(logs.FailedToDiscardPutPayloadProbablyGoroutineLeaks, zap.Error(errDiscard), logs.TagField(logs.TagExternalStorage))
|
||||
n.reqLogger(ctx).Warn(logs.FailedToDiscardPutPayloadProbablyGoroutineLeaks, zap.Error(errDiscard), logs.TagField(logs.TagDatapath))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -139,7 +139,7 @@ func resolveCID(log *zap.Logger, resolveContainerID ContainerIDResolveFunc) cidR
|
|||
|
||||
containerID, err := resolveContainerID(ctx, reqInfo.BucketName)
|
||||
if err != nil {
|
||||
reqLogOrDefault(ctx, log).Debug(logs.FailedToResolveCID, zap.Error(err), logs.TagField(logs.TagExternalBlockchain))
|
||||
reqLogOrDefault(ctx, log).Debug(logs.FailedToResolveCID, zap.Error(err), logs.TagField(logs.TagDatapath))
|
||||
return ""
|
||||
}
|
||||
|
||||
|
|
|
@ -154,42 +154,42 @@ const (
|
|||
CouldntCacheCors = "couldn't cache cors"
|
||||
CouldntCacheListPolicyChains = "couldn't cache list policy chains"
|
||||
CouldntCacheLifecycleConfiguration = "couldn't cache lifecycle configuration"
|
||||
GetBucketCors = "get bucket cors"
|
||||
GetBucketInfo = "get bucket info"
|
||||
ResolveBucket = "resolve bucket"
|
||||
FailedToResolveCID = "failed to resolve CID"
|
||||
FailedToDiscardPutPayloadProbablyGoroutineLeaks = "failed to discard put payload, probably goroutine leaks"
|
||||
)
|
||||
|
||||
// External storage.
|
||||
const (
|
||||
ObjectIsCopied = "object is copied"
|
||||
CouldntDeleteObject = "couldn't delete object"
|
||||
CouldNotListUserContainers = "could not list user containers"
|
||||
CouldNotFetchContainerInfo = "could not fetch container info"
|
||||
CouldntDeleteObjectFromStorageContinueDeleting = "couldn't delete object from storage, continue deleting from tree"
|
||||
FailedToPutTombstoneObject = "failed to put tombstone object"
|
||||
FailedToListAllObjectRelations = "failed to list all object relations"
|
||||
FailedToPutTombstones = "failed to put tombstones"
|
||||
CouldntDeleteCorsObject = "couldn't delete cors object"
|
||||
BucketIsCreated = "bucket is created"
|
||||
CouldntDeleteOldPartObject = "couldn't delete old part object"
|
||||
CouldNotPutCompletedObject = "could not put a completed object (multipart upload)"
|
||||
CouldNotDeleteUploadPart = "could not delete upload part"
|
||||
PutObject = "put object"
|
||||
CouldNotFetchObjectMeta = "could not fetch object meta"
|
||||
FailedToDiscardPutPayloadProbablyGoroutineLeaks = "failed to discard put payload, probably goroutine leaks"
|
||||
FailedToDeleteObject = "failed to delete object"
|
||||
CouldntDeleteLifecycleObject = "couldn't delete lifecycle configuration object"
|
||||
ObjectIsCopied = "object is copied"
|
||||
CouldntDeleteObject = "couldn't delete object"
|
||||
CouldNotListUserContainers = "could not list user containers"
|
||||
CouldNotFetchContainerInfo = "could not fetch container info"
|
||||
CouldntDeleteObjectFromStorageContinueDeleting = "couldn't delete object from storage, continue deleting from tree"
|
||||
FailedToPutTombstoneObject = "failed to put tombstone object"
|
||||
FailedToListAllObjectRelations = "failed to list all object relations"
|
||||
FailedToPutTombstones = "failed to put tombstones"
|
||||
CouldntDeleteCorsObject = "couldn't delete cors object"
|
||||
BucketIsCreated = "bucket is created"
|
||||
CouldntDeleteOldPartObject = "couldn't delete old part object"
|
||||
CouldNotPutCompletedObject = "could not put a completed object (multipart upload)"
|
||||
CouldNotDeleteUploadPart = "could not delete upload part"
|
||||
PutObject = "put object"
|
||||
CouldNotFetchObjectMeta = "could not fetch object meta"
|
||||
FailedToDeleteObject = "failed to delete object"
|
||||
CouldntDeleteLifecycleObject = "couldn't delete lifecycle configuration object"
|
||||
)
|
||||
|
||||
// External blockchain.
|
||||
const (
|
||||
UserGroupsListIsEmpty = "user groups list is empty, subject not found"
|
||||
ResolveBucket = "resolve bucket"
|
||||
FailedToResolveCID = "failed to resolve CID"
|
||||
GetBucketInfo = "get bucket info"
|
||||
)
|
||||
|
||||
// External storage tree.
|
||||
const (
|
||||
FoundMoreThanOneUnversionedNode = "found more than one unversioned node"
|
||||
GetBucketCors = "get bucket cors"
|
||||
GetTreeNode = "get tree node"
|
||||
InvalidTreeKV = "invalid tree service meta KV"
|
||||
FailedToRemoveOldSystemNode = "failed to remove old system node"
|
||||
|
@ -200,6 +200,7 @@ const (
|
|||
BucketTaggingNodeHasMultipleIDs = "bucket tagging node has multiple ids"
|
||||
BucketSettingsNodeHasMultipleIDs = "bucket settings node has multiple ids"
|
||||
BucketCORSNodeHasMultipleIDs = "bucket cors node has multiple ids"
|
||||
GetBucketCorsFromTree = "get bucket cors from tree"
|
||||
)
|
||||
|
||||
// Authmate.
|
||||
|
|
Loading…
Add table
Reference in a new issue