Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RecoverMiddleware = func(log *logrus.Logger) echo.MiddlewareFunc { return middleware.RecoverWithConfig( middleware.RecoverConfig{ LogErrorFunc: func(c echo.Context, err error, stack []byte) error { log.WithFields(logrus.Fields{ "error": err.Error(), "stack": string(stack), "URI": c.Request().RequestURI, "method": c.Request().Method, "status": c.Response().Status, "type": "recovery", }).Error("recovery") return c.String(http.StatusInternalServerError, "Internal Server Error") }, }) }
RecoverMiddleware is the middleware that recovers from panics and logs the error It returns a middleware function that can be used to register the middleware It uses the provided logger to log the error
Functions ¶
func AccessLogMiddleware ¶
AccessLogMiddleware is the middleware that logs the access log It returns a middleware function that can be used to register the middleware It uses the provided logger to log the access log
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.