From 3e4a4f9c67ebc08fed0b4dff90c707ddbc608832 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Wed, 26 Jul 2023 06:21:09 +0800 Subject: [PATCH] Fix incorrect router logger (#26137) A low-level mistake: * `log.Info` is global `Info` function, which calls "default" logger * `logger.Info` is the for router's logger --- modules/web/routing/logger.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/web/routing/logger.go b/modules/web/routing/logger.go index 6a4dae66f79..5f3a7592af0 100644 --- a/modules/web/routing/logger.go +++ b/modules/web/routing/logger.go @@ -89,13 +89,13 @@ func logPrinter(logger log.Logger) func(trigger Event, record *requestRecord) { if v, ok := record.responseWriter.(types.ResponseStatusProvider); ok { status = v.WrittenStatus() } - logf := log.Info + logf := logger.Info if strings.HasPrefix(req.RequestURI, "/assets/") { - logf = log.Trace + logf = logger.Trace } message := completedMessage if isUnknownHandler { - logf = log.Error + logf = logger.Error message = unknownHandlerMessage }