diff --git a/rest/engine.go b/rest/engine.go index a206b3ce..e57786ca 100644 --- a/rest/engine.go +++ b/rest/engine.go @@ -217,9 +217,12 @@ func (ng *engine) notFoundHandler(next http.Handler) http.Handler { handler.TraceHandler(ng.conf.Name, "", handler.WithTraceIgnorePaths(ng.conf.TraceIgnorePaths)), - ng.getLogHandler(), ) + if ng.conf.Middlewares.Log { + chn = chn.Append(ng.getLogHandler()) + } + var h http.Handler if next != nil { h = chn.Then(next)