Logging cleanup (#843)
* Logging cleanup Changes log levels to better match significance * fix lock
This commit is contained in:
+5
-2
@@ -122,8 +122,10 @@ func createRedisClient(conf *config.Config) (*redis.Client, error) {
|
||||
}
|
||||
}
|
||||
|
||||
values := make([]interface{}, 0)
|
||||
values = append(values, "sentinel", conf.UseSentinel())
|
||||
if conf.UseSentinel() {
|
||||
logger.Infow("using multi-node routing via redis", "sentinel", true, "addr", conf.Redis.SentinelAddresses, "masterName", conf.Redis.MasterName)
|
||||
values = append(values, "addr", conf.Redis.SentinelAddresses, "masterName", conf.Redis.MasterName)
|
||||
rcOptions := &redis.FailoverOptions{
|
||||
SentinelAddrs: conf.Redis.SentinelAddresses,
|
||||
SentinelUsername: conf.Redis.SentinelUsername,
|
||||
@@ -136,7 +138,7 @@ func createRedisClient(conf *config.Config) (*redis.Client, error) {
|
||||
}
|
||||
rc = redis.NewFailoverClient(rcOptions)
|
||||
} else {
|
||||
logger.Infow("using multi-node routing via redis", "sentinel", false, "addr", conf.Redis.Address)
|
||||
values = append(values, "addr", conf.Redis.Address)
|
||||
rcOptions := &redis.Options{
|
||||
Addr: conf.Redis.Address,
|
||||
Username: conf.Redis.Username,
|
||||
@@ -146,6 +148,7 @@ func createRedisClient(conf *config.Config) (*redis.Client, error) {
|
||||
}
|
||||
rc = redis.NewClient(rcOptions)
|
||||
}
|
||||
logger.Infow("using multi-node routing via redis", values...)
|
||||
|
||||
if err := rc.Ping(context.Background()).Err(); err != nil {
|
||||
err = errors.Wrap(err, "unable to connect to redis")
|
||||
|
||||
Reference in New Issue
Block a user