From 782b137682cc96ac7c1af1d67a7bfbf6b24f208f Mon Sep 17 00:00:00 2001 From: Giteabot Date: Tue, 25 Jul 2023 20:37:43 -0400 Subject: [PATCH] Fix incorrect router logger (#26137) (#26143) Backport #26137 by @wxiaoguang A low-level mistake: * `log.Info` is global `Info` function, which calls "default" logger * `logger.Info` is the for router's logger Co-authored-by: wxiaoguang --- 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 b58065aa73..a5af26826d 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.(context.ResponseWriter); ok { status = v.Status() } - 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 } -- 2.39.5