Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 436 Bytes

File metadata and controls

24 lines (18 loc) · 436 Bytes

LogZ for echo middleware

Helpful middleware for echo framework.

import "github.com/worldline-go/logz/logecho"

Usage

e.Use(
    middleware.RequestID(),
    middleware.RequestLoggerWithConfig(logecho.RequestLoggerConfig()),
    logecho.ZerologLogger(),
)

To get back the logger from the context:

// this will show the request ID in the log
log.Ctx(c.Request().Context()).Info().Msg("Hello world")