From 6f707ffdfcd27337124a1e1ebe95ebcd25b23ee7 Mon Sep 17 00:00:00 2001 From: Frank Schroeder Date: Fri, 5 Jan 2018 09:30:28 +0100 Subject: [PATCH] Issue #408: log consul state changes as DEBUG This patch changes the log level for Consul raft log changes from INFO to DEBUG so that most users will not see this anymore. High change rate is usually an indicator for flapping services or health checks with volatile output like timestamps but that problem should be dealt with on the Consul side. A PR for #368 will to add an indicator for the change rate of the Consul state. Fixes #408 --- cert/consul_source.go | 2 +- registry/consul/kv.go | 2 +- registry/consul/service.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cert/consul_source.go b/cert/consul_source.go index d71acc9d2..b83cc0d71 100644 --- a/cert/consul_source.go +++ b/cert/consul_source.go @@ -120,7 +120,7 @@ func watchKV(client *api.Client, key string, pemBlocks chan map[string][]byte) { } if !reflect.DeepEqual(value, lastValue) || index != lastIndex { - log.Printf("[INFO] cert: Certificate index changed to #%d", index) + log.Printf("[DEBUG] cert: Certificate index changed to #%d", index) pemBlocks <- value lastValue, lastIndex = value, index } diff --git a/registry/consul/kv.go b/registry/consul/kv.go index af2c13942..bc6eabaab 100644 --- a/registry/consul/kv.go +++ b/registry/consul/kv.go @@ -23,7 +23,7 @@ func watchKV(client *api.Client, path string, config chan string) { } if value != lastValue || index != lastIndex { - log.Printf("[INFO] consul: Manual config changed to #%d", index) + log.Printf("[DEBUG] consul: Manual config changed to #%d", index) config <- value lastValue, lastIndex = value, index } diff --git a/registry/consul/service.go b/registry/consul/service.go index d6addbbe2..2de1487f5 100644 --- a/registry/consul/service.go +++ b/registry/consul/service.go @@ -27,7 +27,7 @@ func watchServices(client *api.Client, tagPrefix string, status []string, config continue } - log.Printf("[INFO] consul: Health changed to #%d", meta.LastIndex) + log.Printf("[DEBUG] consul: Health changed to #%d", meta.LastIndex) config <- servicesConfig(client, passingServices(checks, status), tagPrefix) lastIndex = meta.LastIndex }