diff --git a/discovery/zookeeper/zookeeper.go b/discovery/zookeeper/zookeeper.go index 7345331c3..2aada9d58 100644 --- a/discovery/zookeeper/zookeeper.go +++ b/discovery/zookeeper/zookeeper.go @@ -68,7 +68,7 @@ func NewDiscovery( } conn, _, err := zk.Connect(srvs, timeout) - conn.SetLogger(treecache.ZookeeperLogger{}) + conn.SetLogger(treecache.NewZookeeperLogger(logger)) if err != nil { return nil } diff --git a/util/treecache/treecache.go b/util/treecache/treecache.go index 190e0149b..75b069a39 100644 --- a/util/treecache/treecache.go +++ b/util/treecache/treecache.go @@ -49,6 +49,11 @@ type ZookeeperLogger struct { logger log.Logger } +// NewZookeeperLogger is a constructor for ZookeeperLogger +func NewZookeeperLogger(logger log.Logger) ZookeeperLogger { + return ZookeeperLogger{logger: logger} +} + // Implements zk.Logger func (zl ZookeeperLogger) Printf(s string, i ...interface{}) { level.Info(zl.logger).Log("msg", fmt.Sprintf(s, i...))