Categorygithub.com/julienp/httplog
modulepackage
0.1.1
Repository: https://github.com/julienp/httplog.git
Documentation: pkg.go.dev

# README

httplog

Middleware for http.Handler that logs each request to logrus.

Most of the fields match standard HTTP fields for Datadog.

Example usage with gorilla/mux:

log := logrus.StandardLogger()
router := mux.NewRouter()
router.Use(WithHTTPLogging(log.WithField("service", "my-http-service")))

# Functions

WithHTTPLogging adds HTTP request logging to the Handler h.

# Structs

LogRecord warps a http.ResponseWriter and records the status.