mirror of
https://github.com/labstack/echo.git
synced 2026-05-18 10:01:24 +02:00
054a310e70
Signed-off-by: Vishal Rana <vr@labstack.com>
1.0 KiB
1.0 KiB
+++ title = "Customization" description = "Customizing Echo" [menu.main] name = "Customization" parent = "guide" weight = 3 +++
HTTP Error Handler
Default HTTP error handler rules:
- If error is of type
Echo#HTTPErrorit sends HTTP response with status codeHTTPError.Codeand 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:
DEBUGINFOWARNERROROFF
You can also set a custom logger using Echo#Logger.