From 24a25453f65a6760e20ce5919ec860cc59ad9915 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 30 Sep 2016 10:18:19 +0200 Subject: [PATCH] fix(server): shutdown logging fixes --- pkg/cmd/grafana-server/main.go | 2 +- pkg/cmd/grafana-server/server.go | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/cmd/grafana-server/main.go b/pkg/cmd/grafana-server/main.go index ad236edf545..6cd063f798f 100644 --- a/pkg/cmd/grafana-server/main.go +++ b/pkg/cmd/grafana-server/main.go @@ -107,7 +107,7 @@ func listenToSystemSignals(server models.GrafanaServer) { select { case sig := <-signalChan: - server.Shutdown(0, fmt.Sprintf("system signal=%s", sig)) + server.Shutdown(0, fmt.Sprintf("system signal: %s", sig)) case code = <-exitChan: server.Shutdown(code, "startup error") } diff --git a/pkg/cmd/grafana-server/server.go b/pkg/cmd/grafana-server/server.go index 5ffdba5804f..7523b0e12af 100644 --- a/pkg/cmd/grafana-server/server.go +++ b/pkg/cmd/grafana-server/server.go @@ -103,13 +103,12 @@ func (g *GrafanaServerImpl) startHttpServer() { } func (g *GrafanaServerImpl) Shutdown(code int, reason string) { - log.Info("Shutting down", "code", code, "reason", reason) + g.log.Info("Shutting down", "code", code, "reason", reason) g.shutdownFn() err := g.childRoutines.Wait() - log.Info("Shutting down completed", "error", err) - + g.log.Info("Shutting down completed", "reason", err) log.Close() os.Exit(code) }