Documentation ¶
Overview ¶
Package logger provides functions to set up a new logger
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetLogger ¶
SetLogger returns a middleware that logs the start and end of each request, along with some useful data about what was requested, what the response status was, and how long it took to return. Inspired by https://github.com/treastech/logger func SetLogger(l *Logger, publisher publisher) func(next http.Handler) http.Handler {
Types ¶
type Logger ¶
Logger is a small wrapper around a zap.Logger.
func New ¶
func New(logLevel, logFormat string, logHttpRequest bool, cfg *config.LogPublisher) (*Logger, error)
New creates a new Logger with given logLevel and logFormat as part of a permanent field of the logger.
Click to show internal directories.
Click to hide internal directories.