ligten bucket logger (#2523)

This commit is contained in:
Thibault "bui" Koechlin 2023-10-06 14:42:44 +02:00 committed by GitHub
parent 338141f067
commit 6c20d38c41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 3 deletions

View file

@ -216,7 +216,7 @@ func LeakRoutine(leaky *Leaky) error {
defer BucketsCurrentCount.With(prometheus.Labels{"name": leaky.Name}).Dec()
/*todo : we create a logger at runtime while we want leakroutine to be up asap, might not be a good idea*/
leaky.logger = leaky.BucketConfig.logger.WithFields(log.Fields{"capacity": leaky.Capacity, "partition": leaky.Mapkey, "bucket_id": leaky.Uuid})
leaky.logger = leaky.BucketConfig.logger.WithFields(log.Fields{"partition": leaky.Mapkey, "bucket_id": leaky.Uuid})
//We copy the processors, as they are coming from the BucketFactory, and thus are shared between buckets
//If we don't copy, processors using local cache (such as Uniq) are subject to race conditions

View file

@ -284,14 +284,12 @@ func LoadBucket(bucketFactory *BucketFactory, tomb *tomb.Tomb) error {
bucketFactory.logger = clog.WithFields(log.Fields{
"cfg": bucketFactory.BucketName,
"name": bucketFactory.Name,
"file": bucketFactory.Filename,
})
} else {
/* else bind it to the default one (might find something more elegant here)*/
bucketFactory.logger = log.WithFields(log.Fields{
"cfg": bucketFactory.BucketName,
"name": bucketFactory.Name,
"file": bucketFactory.Filename,
})
}