Documentation ¶
Overview ¶
Package logrusmiddleware is a simple net/http middleware for logging using logrus
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct { http.ResponseWriter // contains filtered or unexported fields }
Handler is the actual middleware that handles logging
func (*Handler) ServeHTTP ¶
func (h *Handler) ServeHTTP(rw http.ResponseWriter, r *http.Request)
ServeHTTP calls the "real" handler and logs using the logger
func (*Handler) WriteHeader ¶
WriteHeader is a wrapper around ResponseWriter.WriteHeader
type Middleware ¶
type Middleware struct { // Logger is the log.Logger instance used to log messages with the Logger middleware Logger *logrus.Logger // Name is the name of the application as recorded in latency metrics Name string }
Middleware is a middleware handler for HTTP logging
Click to show internal directories.
Click to hide internal directories.