labstack / echo

High performance, minimalist Go web framework

Home Page:https://echo.labstack.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cant print debug stack using middleware Recover() and Timeout()

gitouyoung opened this issue · comments

This is my middlewares:

middleware.Recover(),
middleware.TimeoutWithConfig(middleware.TimeoutConfig{
	Skipper: func(c echo.Context) bool {
		return strings.HasPrefix(c.Request().RequestURI, "/debug/pprof/")
	},
	ErrorMessage: "timeout",
	Timeout:      10 * time.Second,
}),

after I add timeout middleware, log cannot show where panic occurs, the stack output always be like :
image

If I remove timeout middleware, log shows where panic occurs. the stack output is:
image

I wonder how can Recover() print panic stack correctly while using both Recover() and Timeout()