Documentation ¶
Index ¶
- func ContentLength(rq *http.Request) int
- 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 Sequence(rq *http.Request) uint64
- func StatusCode(rq *http.Request) int
- func UID(rq *http.Request) uuid.UUID
- 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 WithStatusCode(rq *http.Request, status int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContentLength ¶ added in v0.1.1
ContentLength returns content length previously pushed into the request context. Returns 0 if no content length was pushed.
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 ¶
Middleware is logging middleware constructor
func Sequence ¶ added in v0.1.2
Sequence returns request sequence from the request context. Returns 0 if not found in the context.
func StatusCode ¶ added in v0.1.1
StatusCode returns status code previously pushed into the request context. Returns 0 if no status was pushed.
func UID ¶ added in v0.1.2
UID returns request identifier from the request context. Returns zero UUID if not found in the context.
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 WithStatusCode ¶ added in v0.1.1
WithStatusCode pushes response status code into the access logger associated with the request.
Types ¶
This section is empty.