Skip to content

Commit

Permalink
Issue #408: log consul state changes as DEBUG
Browse files Browse the repository at this point in the history
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
  • Loading branch information
magiconair committed Jan 5, 2018
1 parent c30d642 commit 6f707ff
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cert/consul_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion registry/consul/kv.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion registry/consul/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 6f707ff

Please sign in to comment.