Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultLoggerConfig is the default Logger middleware config. DefaultLoggerConfig = LoggerConfig{ Skipper: middleware.DefaultSkipper, AccessLogFormat: accessLogFormat, BodyDumpFormat: bodyDumpFormat, CustomTimeFormat: "2006-01-02 15:04:05.00000", // contains filtered or unexported fields } )
Functions ¶
func AccessLoggerWithConfig ¶
func AccessLoggerWithConfig(config LoggerConfig) echo.MiddlewareFunc
AccessLoggerWithConfig returns a Logger middleware with config.
func MethodNotAllowedAndRouteNotFound ¶ added in v1.1.28
func MethodNotAllowedAndRouteNotFound() echo.MiddlewareFunc
MethodNotAllowedAndRouteNotFound middleware will reply HTTP 405 if a wrong method been called for an API route. This middleware will also return 404 if a page doesn't exist.
func ServerHeader ¶
func ServerHeader(name, version string) echo.MiddlewareFunc
ServerHeader middleware adds a `Server` header to the response.
Types ¶
type LoggerConfig ¶
type LoggerConfig struct { // Skipper defines a function to skip middleware. Skipper middleware.Skipper // Optional. Default value DefaultLoggerConfig.AccessLogFormat. AccessLogFormat string `yaml:"format"` // Optional. Default value DefaultLoggerConfig.BodyDumpFormat. BodyDumpFormat string `yaml:"format"` // Optional. Default value DefaultLoggerConfig.CustomTimeFormat. CustomTimeFormat string `yaml:"custom_time_format"` // Output is a writer where logs in JSON format are written. // Optional. Default value os.Stdout. Output io.Writer // BodyDump is an option to control the log also print the request and response body. // Optional. Default value false. BodyDump bool // MaskedParameters is a slice of parameters for which the user wants to mask the value in logs. // Optional. Default value []. MaskedParameters []string // RequestHeader is a slice of HTTP request header parameters which user wants to log. RequestHeader []string // contains filtered or unexported fields }
LoggerConfig defines the config for Logger middleware.
Click to show internal directories.
Click to hide internal directories.