ligten bucket logger (#2523)
This commit is contained in:
parent
338141f067
commit
6c20d38c41
2 changed files with 1 additions and 3 deletions
|
@ -216,7 +216,7 @@ func LeakRoutine(leaky *Leaky) error {
|
||||||
defer BucketsCurrentCount.With(prometheus.Labels{"name": leaky.Name}).Dec()
|
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*/
|
/*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
|
//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
|
//If we don't copy, processors using local cache (such as Uniq) are subject to race conditions
|
||||||
|
|
|
@ -284,14 +284,12 @@ func LoadBucket(bucketFactory *BucketFactory, tomb *tomb.Tomb) error {
|
||||||
bucketFactory.logger = clog.WithFields(log.Fields{
|
bucketFactory.logger = clog.WithFields(log.Fields{
|
||||||
"cfg": bucketFactory.BucketName,
|
"cfg": bucketFactory.BucketName,
|
||||||
"name": bucketFactory.Name,
|
"name": bucketFactory.Name,
|
||||||
"file": bucketFactory.Filename,
|
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
/* else bind it to the default one (might find something more elegant here)*/
|
/* else bind it to the default one (might find something more elegant here)*/
|
||||||
bucketFactory.logger = log.WithFields(log.Fields{
|
bucketFactory.logger = log.WithFields(log.Fields{
|
||||||
"cfg": bucketFactory.BucketName,
|
"cfg": bucketFactory.BucketName,
|
||||||
"name": bucketFactory.Name,
|
"name": bucketFactory.Name,
|
||||||
"file": bucketFactory.Filename,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue