Add middleware to include the request ID in all logs.
This commit is contained in:
parent
4096691df0
commit
26e456eae3
5 changed files with 28 additions and 10 deletions
|
|
@ -99,12 +99,11 @@ func (t *Controller) cachePage(c echo.Context, p Page, html *bytes.Buffer) {
|
|||
}
|
||||
err := marshaler.New(t.Container.Cache).Set(c.Request().Context(), key, cp, opts)
|
||||
if err != nil {
|
||||
c.Logger().Errorf("failed to cache page: %s", key)
|
||||
c.Logger().Error(err)
|
||||
c.Logger().Errorf("failed to cache page: %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
c.Logger().Infof("cached page for: %s", key)
|
||||
c.Logger().Infof("cached page")
|
||||
}
|
||||
|
||||
func (t *Controller) parsePageTemplates(p Page) error {
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ func BuildRouter(c *container.Container) {
|
|||
echomw.Recover(),
|
||||
echomw.Gzip(),
|
||||
echomw.Logger(),
|
||||
middleware.LogRequestID(),
|
||||
echomw.TimeoutWithConfig(echomw.TimeoutConfig{
|
||||
Timeout: c.Config.App.Timeout,
|
||||
}),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue