echo icon indicating copy to clipboard operation
echo copied to clipboard

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

Open gitouyoung opened this issue 9 months ago • 0 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()

gitouyoung avatar May 23 '24 04:05 gitouyoung