chi-logger
is a simple logging middleware for Chi with support for Zap
and Logrus
go get github.com/766b/chi-logger
logger := logrus.New()
r := chi.NewRouter()
r.Use(middleware.RequestID)
r.Use(middleware.RealIP)
r.Use(chilogger.NewLogrusMiddleware("router", logger))
...
logger, _ := zap.NewProduction()
r := chi.NewRouter()
r.Use(middleware.RequestID)
r.Use(middleware.RealIP)
r.Use(chilogger.NewZapMiddleware("router", logger))
...