fix: only add log middleware to not found handler when enabled (#3969)

master^2
Alex Last 8 months ago committed by GitHub
parent 2096cd5749
commit ba1d6e3664
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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)

Loading…
Cancel
Save