common: fix unclosed logrus logging pipes
This commit is contained in:
parent
0c325137cf
commit
1cde7e341b
4 changed files with 67 additions and 36 deletions
|
|
@ -8,11 +8,10 @@ import (
|
|||
// Store context in request logger to propagate correlation ids
|
||||
func LoggerMiddleware(next echo.HandlerFunc) echo.HandlerFunc {
|
||||
return func(c echo.Context) error {
|
||||
c.SetLogger(&EchoLogrusLogger{
|
||||
Logger: logrus.StandardLogger(),
|
||||
Ctx: c.Request().Context(),
|
||||
})
|
||||
ell := NewEchoLogrusLogger(logrus.StandardLogger(), c.Request().Context())
|
||||
defer ell.Close()
|
||||
|
||||
c.SetLogger(ell)
|
||||
return next(c)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue