Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccessLog ¶ added in v0.21.0
func AccessLog(log *slog.Logger) echo.MiddlewareFunc
AccessLog writes the one result record for each request: the access fields, and for a failed request the error fields of its attribution. It recovers a panic into an error with the stack of the panic, and answers an error that is still unanswered through the shell's HTTP error handler, so the record carries the status that was sent.
Install it directly after telemetry.EchoServer, so the record is logged with the request's span and every middleware below it is covered.
func NewHTTPErrorHandler ¶ added in v0.21.0
func NewHTTPErrorHandler(log *slog.Logger) echo.HTTPErrorHandler
NewHTTPErrorHandler renders every error a request ends with as a Problem. It does not log the error: the access log writes the one result record for the request. An HTTP shell installs it together with AccessLog.
func PublicError ¶ added in v0.21.0
PublicError is the public error a transport answers err with, and the error its result record attributes, chosen by the rule the HTTP error handler applies. A WebSocket handler renders its error frames from it, so a request is answered with the same code whichever transport carried it.