Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultLoggingFunc ¶
DefaultLoggingFunc is default write log function
func Middleware ¶
func Middleware(config *Config) echo.MiddlewareFunc
Middleware echo write log middleware
Types ¶
type Config ¶
type Config struct { Skipper em.Skipper LoggingFunc LoggingFunc }
Config is Middleware config
type DefaultLogField ¶
type DefaultLogField struct { Type string `json:"type"` Status int `json:"status"` Method string `json:"method"` Path string `json:"path"` UserAgent string `json:"userAgent"` RemoteIP string `json:"remoteIp"` ForwardedFor string `json:"forwardedFor"` Latency int `json:"latency"` Error string `json:"error"` RequestID string `json:"requestId"` }
DefaultLogField echo default log fields.
func (*DefaultLogField) ToJSON ¶
func (d *DefaultLogField) ToJSON() ([]byte, error)
ToJSON struct attributes to json
func (*DefaultLogField) ToMap ¶
func (d *DefaultLogField) ToMap() map[string]interface{}
ToMap struct attributes to map
type LoggingFunc ¶
LoggingFunc is write log function
Click to show internal directories.
Click to hide internal directories.