diff --git a/cmd/web.go b/cmd/web.go index 6953e7c64f5d..963c81620747 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -86,6 +86,11 @@ func runWeb(ctx *cli.Context) error { _ = log.DelLogger("console") log.NewLogger(0, "console", "console", fmt.Sprintf(`{"level": "fatal", "colorize": %t, "stacktraceLevel": "none"}`, log.CanColorStdout)) } + defer func() { + if panicked := recover(); panicked != nil { + log.Fatal("PANIC: %v\n%s", panicked, string(log.Stack(2))) + } + }() managerCtx, cancel := context.WithCancel(context.Background()) graceful.InitManager(managerCtx)