Commit 24a25453 by Torkel Ödegaard

fix(server): shutdown logging fixes

parent 5ec86a9e
...@@ -107,7 +107,7 @@ func listenToSystemSignals(server models.GrafanaServer) { ...@@ -107,7 +107,7 @@ func listenToSystemSignals(server models.GrafanaServer) {
select { select {
case sig := <-signalChan: case sig := <-signalChan:
server.Shutdown(0, fmt.Sprintf("system signal=%s", sig)) server.Shutdown(0, fmt.Sprintf("system signal: %s", sig))
case code = <-exitChan: case code = <-exitChan:
server.Shutdown(code, "startup error") server.Shutdown(code, "startup error")
} }
......
...@@ -103,13 +103,12 @@ func (g *GrafanaServerImpl) startHttpServer() { ...@@ -103,13 +103,12 @@ func (g *GrafanaServerImpl) startHttpServer() {
} }
func (g *GrafanaServerImpl) Shutdown(code int, reason string) { 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() g.shutdownFn()
err := g.childRoutines.Wait() err := g.childRoutines.Wait()
log.Info("Shutting down completed", "error", err) g.log.Info("Shutting down completed", "reason", err)
log.Close() log.Close()
os.Exit(code) os.Exit(code)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment