mirror of
https://github.com/labstack/echo.git
synced 2024-12-24 20:14:31 +02:00
57c7dccfbf
Signed-off-by: Vishal Rana <vishal.rana@verizon.com>
1.0 KiB
1.0 KiB
+++ title = "Customization" description = "Customizing Echo" [menu.side] name = "Customization" parent = "guide" weight = 3 +++
HTTP Error Handler
Default HTTP error handler rules:
- If error is of type
Echo#HTTPError
it sends HTTP response with status codeHTTPError.Code
and messageHTTPError.Message
. - Else it sends
500 - Internal Server Error
. - If debug mode is enabled, it uses
error.Error()
as status message.
You can also set a custom HTTP error handler using Echo#HTTPErrorHandler
.
Debugging
Echo#Debug
enables/disables debug mode.
Logging
Log Output
Echo#Logger.SetOutput(io.Writer)
sets the output destination for the logger.
Default value os.Stdout
To completely disable logs use Echo#Logger.SetOutput(io.Discard)
or Echo#Logger.SetLevel(log.OFF)
Log Level
Echo#Logger.SetLevel(log.Lvl)
SetLogLevel sets the log level for the logger. Default value OFF
.
Possible values:
DEBUG
INFO
WARN
ERROR
OFF
You can also set a custom logger using Echo#Logger
.