1
0
mirror of https://github.com/docker/docs.git synced 2026-11-05 00:14:17 +03:00

[PATCH 6/8] Feature: hot configuration reload for notary server

This patch will allow people to use SIGHUP to tell notary server to
reload the configuration file.

For now it only supports to reload the logging level.

Signed-off-by: Hu Keping <hukeping@huawei.com>
This commit is contained in:
HuKeping
2016-05-20 04:52:12 +08:00
parent d2149d804b
commit 229cf08cc9

View File

@@ -309,6 +309,14 @@ func reloadConfig(sig os.Signal, configFile string, oldConfig *viper.Viper, envP
fmt.Println("Decrease log level failed, will use the old one, error: ", err)
return
}
case syscall.SIGHUP:
// We use SIGHUP to allow people to reset the logging level as their wish.
lvl, err := utils.ParseLogLevel(config, logrus.ErrorLevel)
if err != nil {
fmt.Println("Parse log level failed, will use the old one, error: ", err)
return
}
logrus.SetLevel(lvl)
}
fmt.Println("Successfully setting log level to ", logrus.GetLevel())