Documentation ¶
Index ¶
- Variables
- func Middleware(config Config) echo.MiddlewareFunc
- type Config
- type Logger
- func (l *Logger) Debugj(j log.JSON)
- func (l *Logger) Errorj(j log.JSON)
- func (l *Logger) Fatalj(j log.JSON)
- func (l *Logger) Infoj(j log.JSON)
- func (l *Logger) Level() log.Lvl
- func (l *Logger) Output() io.Writer
- func (l *Logger) Panicj(j log.JSON)
- func (l *Logger) Prefix() string
- func (l *Logger) Printj(j log.JSON)
- func (l *Logger) SetHeader(h string)
- func (l *Logger) SetLevel(lvl log.Lvl)
- func (l *Logger) SetOutput(w io.Writer)
- func (l *Logger) SetPrefix(prefix string)
- func (l *Logger) Warnj(j log.JSON)
- type Skipper
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultConfig is the default Logger middleware config. DefaultConfig = Config{ Logger: logrus.StandardLogger(), Skipper: func(c echo.Context) bool { return false }, Fields: []string{"ip", "latency", "status"}, Status: 0, } )
Functions ¶
func Middleware ¶
func Middleware(config Config) echo.MiddlewareFunc
Middleware returns a Logger middleware with config.
Types ¶
type Config ¶
type Config struct { Logger *logrus.Logger // Skipper defines a function to skip middleware. Skipper Skipper // Fields available for logging // - id (Request ID) // - ip // - host // - referer // - user_agent // - status // - latency // - headers Fields []string Status int }
Config defines the config for Logger middleware.
Click to show internal directories.
Click to hide internal directories.