Skip to content

Latest commit

 

History

History
37 lines (25 loc) · 1.24 KB

README.md

File metadata and controls

37 lines (25 loc) · 1.24 KB

Chi logrus-logger middleware

logrus-logger is a request logging middleware for Chi using Logrus logging library

Documentation codecov Go Report Card Build Status

Usage

Import using:

import "github.com/chi-middleware/logrus-logger"

Use middleware with default (Info) logging level:

    log := logrus.New()

    r := chi.NewRouter()
    r.Use(logger.Logger("router", log))

or

Use middleware with Debug logging level:

    log := logrus.New()
    log.SetLevel(logrus.TraceLevel)

    r := chi.NewRouter()
    r.Use(logger.LoggerWithLevel("router", log, logrus.DebugLevel))