fix: only add log middleware to not found handler when enabled (#3969)
This commit is contained in:
@@ -217,9 +217,12 @@ func (ng *engine) notFoundHandler(next http.Handler) http.Handler {
|
|||||||
handler.TraceHandler(ng.conf.Name,
|
handler.TraceHandler(ng.conf.Name,
|
||||||
"",
|
"",
|
||||||
handler.WithTraceIgnorePaths(ng.conf.TraceIgnorePaths)),
|
handler.WithTraceIgnorePaths(ng.conf.TraceIgnorePaths)),
|
||||||
ng.getLogHandler(),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if ng.conf.Middlewares.Log {
|
||||||
|
chn = chn.Append(ng.getLogHandler())
|
||||||
|
}
|
||||||
|
|
||||||
var h http.Handler
|
var h http.Handler
|
||||||
if next != nil {
|
if next != nil {
|
||||||
h = chn.Then(next)
|
h = chn.Then(next)
|
||||||
|
|||||||
Reference in New Issue
Block a user