diff --git a/registry/consul/watcher.go b/registry/consul/watcher.go index a3d894a7..2fc81886 100644 --- a/registry/consul/watcher.go +++ b/registry/consul/watcher.go @@ -2,6 +2,8 @@ package consul import ( "errors" + "log" + "os" "sync" "github.com/hashicorp/consul/api" @@ -43,7 +45,7 @@ func newConsulWatcher(cr *consulRegistry, opts ...registry.WatchOption) (registr } wp.Handler = cw.handle - go wp.Run(cr.Address) + go wp.RunWithClientAndLogger(cr.Client, log.New(os.Stderr, "", log.LstdFlags)) cw.wp = wp return cw, nil @@ -208,7 +210,7 @@ func (cw *consulWatcher) handle(idx uint64, data interface{}) { }) if err == nil { wp.Handler = cw.serviceHandler - go wp.Run(cw.r.Address) + go wp.RunWithClientAndLogger(cw.r.Client, log.New(os.Stderr, "", log.LstdFlags)) cw.watchers[service] = wp cw.next <- ®istry.Result{Action: "create", Service: ®istry.Service{Name: service}} }