Prechádzať zdrojové kódy

Merge pull request #12439 from grafana/fix-log-close-too-early

Fix: Log close (ie flush) was done too early, before final shutdown log
Marcus Efraimsson 7 rokov pred
rodič
commit
59756863df

+ 0 - 4
pkg/cmd/grafana-server/main.go

@@ -14,7 +14,6 @@ import (
 	"net/http"
 	"net/http"
 	_ "net/http/pprof"
 	_ "net/http/pprof"
 
 
-	"github.com/grafana/grafana/pkg/log"
 	"github.com/grafana/grafana/pkg/metrics"
 	"github.com/grafana/grafana/pkg/metrics"
 	"github.com/grafana/grafana/pkg/setting"
 	"github.com/grafana/grafana/pkg/setting"
 
 
@@ -88,9 +87,6 @@ func main() {
 
 
 	err := server.Run()
 	err := server.Run()
 
 
-	trace.Stop()
-	log.Close()
-
 	server.Exit(err)
 	server.Exit(err)
 }
 }
 
 

+ 2 - 0
pkg/cmd/grafana-server/server.go

@@ -185,6 +185,8 @@ func (g *GrafanaServerImpl) Exit(reason error) {
 	}
 	}
 
 
 	g.log.Error("Server shutdown", "reason", reason)
 	g.log.Error("Server shutdown", "reason", reason)
+
+	log.Close()
 	os.Exit(code)
 	os.Exit(code)
 }
 }