mirror of
https://github.com/labstack/echo.git
synced 2025-12-19 23:52:19 +02:00
Added request logger middleware which helps to use custom logger library for logging requests (#1980)
Added request logger middleware which helps to use custom logger library for logging requests.
This commit is contained in:
5
echo.go
5
echo.go
@@ -357,6 +357,11 @@ func (e *Echo) Routers() map[string]*Router {
|
||||
|
||||
// DefaultHTTPErrorHandler is the default HTTP error handler. It sends a JSON response
|
||||
// with status code.
|
||||
//
|
||||
// NOTE: In case errors happens in middleware call-chain that is returning from handler (which did not return an error).
|
||||
// When handler has already sent response (ala c.JSON()) and there is error in middleware that is returning from
|
||||
// handler. Then the error that global error handler received will be ignored because we have already "commited" the
|
||||
// response and status code header has been sent to the client.
|
||||
func (e *Echo) DefaultHTTPErrorHandler(err error, c Context) {
|
||||
|
||||
if c.Response().Committed {
|
||||
|
||||
Reference in New Issue
Block a user