diff --git a/cmd/notary-server/config.json b/cmd/notary-server/config.json index 42345fe96b..9c41206a35 100644 --- a/cmd/notary-server/config.json +++ b/cmd/notary-server/config.json @@ -8,7 +8,7 @@ "port": "7899", "tls_ca_file": "./fixtures/root-ca.crt" }, "logging": { - "level": 5 + "level": "debug" }, "storage": { "backend": "mysql", diff --git a/cmd/notary-server/dev-config.json b/cmd/notary-server/dev-config.json index b00d95f2be..7026357e69 100644 --- a/cmd/notary-server/dev-config.json +++ b/cmd/notary-server/dev-config.json @@ -10,7 +10,7 @@ "port": "" }, "logging": { - "level": 5 + "level": "debug" }, "storage": { "backend": "mysql", diff --git a/cmd/notary-server/main.go b/cmd/notary-server/main.go index b2bca8ac23..219005ea09 100644 --- a/cmd/notary-server/main.go +++ b/cmd/notary-server/main.go @@ -64,7 +64,12 @@ func main() { logrus.Error("Could not read config at ", configFile) os.Exit(1) } - logrus.SetLevel(logrus.Level(viper.GetInt("logging.level"))) + lvl, err := logrus.ParseLevel(viper.GetString("logging.level")) + if err != nil { + lvl = logrus.ErrorLevel + logrus.Error("Could not parse log level from config. Defaulting to ErrorLevel") + } + logrus.SetLevel(lvl) sigHup := make(chan os.Signal) sigTerm := make(chan os.Signal)