Documentation
¶
Index ¶
- func Debug(rq *http.Request, msg string, fields ...zap.Field)
- func DefaultAccessLogEncoderConfig() zapcore.EncoderConfig
- func DefaultServerLogEncoderConfig() zapcore.EncoderConfig
- func Error(rq *http.Request, msg string, fields ...zap.Field)
- func Fatal(rq *http.Request, msg string, fields ...zap.Field)
- func Info(rq *http.Request, msg string, fields ...zap.Field)
- func Log(next http.Handler) http.Handler
- func Logger(rq *http.Request) *zap.Logger
- func Middleware(aw io.Writer, sw io.Writer, lvl zapcore.Level) func(http.Handler) http.Handler
- func Named(rq *http.Request, s string)
- func Panic(rq *http.Request, msg string, fields ...zap.Field)
- func Warn(rq *http.Request, msg string, fields ...zap.Field)
- func With(rq *http.Request, fields ...zap.Field)
- func WithContentLength(rq *http.Request, n int)
- func WithStatus(rq *http.Request, status int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultAccessLogEncoderConfig ¶
func DefaultAccessLogEncoderConfig() zapcore.EncoderConfig
DefaultAccessLogEncoderConfig returns the default configuration for access logger encoder
func DefaultServerLogEncoderConfig ¶
func DefaultServerLogEncoderConfig() zapcore.EncoderConfig
DefaultServerLogEncoderConfig returns the default configuration for server logger encoder
func Logger ¶
Logger returns server logger associated with the request. If there's no logger associated with the request, returns no-op logger.
func Middleware ¶
func With ¶
With pushes the lest of fields into the context of both access and server loggers associated with the request.
func WithContentLength ¶
WithContentLength pushes response content length into the access logger associated with the request.
func WithStatus ¶
WithStatus pushes response status code into the access logger associated with the request.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.