Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log message for new consul version does not match other patterns for logging #2601

Closed
majormoses opened this issue Dec 16, 2016 · 1 comment

Comments

@majormoses
Copy link
Contributor

consul info for both Client and Server

Client:

$ /opt/consul/0.7.0/consul version
Consul v0.7.0
Protocol 2 spoken by default, understands 2 to 3 (agent will automatically use protocol >2 when speaking to compatible agents)

Server:

$ /opt/consul/0.7.0/consul version
Consul v0.7.0
Protocol 2 spoken by default, understands 2 to 3 (agent will automatically use protocol >2 when speaking to compatible agents)

Operating system and Environment details

Ubuntu 14.04 LTS

Description of the Issue (and unexpected/desired result)

When you have a node that is not running the latest code it is logged in /var/log/upstart/consul.log by default. This log message ==> Newer Consul version available: 0.7.1 (currently running: 0.7.0) does not include the typical log format DATE TIME [LOG_LEVEL] COMPONENT: MESSAGE

Reproduction steps

spin up consul with an older version than latest.

Code in question

I am not very proficient in go so apologies in advance:

This is the line of code that emits the message:

c.Ui.Error(fmt.Sprintf("Newer Consul version available: %s (currently running: %s)", results.CurrentVersion, c.Version))

This feels like it should be writing it out correctly:

for _, alert := range results.Alerts {
switch alert.Level {
case "info":
c.Ui.Info(fmt.Sprintf("Bulletin [%s]: %s (%s)", alert.Level, alert.Message, alert.URL))
default:
c.Ui.Error(fmt.Sprintf("Bulletin [%s]: %s (%s)", alert.Level, alert.Message, alert.URL))
}
}

Am I missing something obvious?

@slackpad
Copy link
Contributor

slackpad commented May 2, 2017

Hi @majormoses this is part of the init logging, please see #1446.

@slackpad slackpad closed this as completed May 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants