feat: add recoverer + request-id http middlewares
This commit is contained in:
parent
4d6958e2f5
commit
be59be1795
|
@ -116,7 +116,9 @@ func (s *Server) run(parentCtx context.Context, addrs chan net.Addr, errs chan e
|
||||||
router.Use(middleware.RealIP)
|
router.Use(middleware.RealIP)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
router.Use(middleware.RequestID)
|
||||||
router.Use(middleware.RequestLogger(bouncerChi.NewLogFormatter()))
|
router.Use(middleware.RequestLogger(bouncerChi.NewLogFormatter()))
|
||||||
|
router.Use(middleware.Recoverer)
|
||||||
|
|
||||||
if s.serverConfig.Sentry.DSN != "" {
|
if s.serverConfig.Sentry.DSN != "" {
|
||||||
logger.Info(ctx, "enabling sentry http middleware")
|
logger.Info(ctx, "enabling sentry http middleware")
|
||||||
|
|
|
@ -121,7 +121,9 @@ func (s *Server) run(parentCtx context.Context, addrs chan net.Addr, errs chan e
|
||||||
router.Use(middleware.RealIP)
|
router.Use(middleware.RealIP)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
router.Use(middleware.RequestID)
|
||||||
router.Use(middleware.RequestLogger(bouncerChi.NewLogFormatter()))
|
router.Use(middleware.RequestLogger(bouncerChi.NewLogFormatter()))
|
||||||
|
router.Use(middleware.Recoverer)
|
||||||
|
|
||||||
if s.serverConfig.Sentry.DSN != "" {
|
if s.serverConfig.Sentry.DSN != "" {
|
||||||
logger.Info(ctx, "enabling sentry http middleware")
|
logger.Info(ctx, "enabling sentry http middleware")
|
||||||
|
|
Loading…
Reference in New Issue