From 2cdf5e73958149f889630cb57ec7e0879c061aed Mon Sep 17 00:00:00 2001 From: vic <1018595261@qq.com> Date: Mon, 20 Dec 2021 19:43:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=92=E9=99=A4=E5=AE=A2=E6=88=B7=E7=AB=AF?= =?UTF-8?q?=E4=B8=AD=E6=96=AD=E5=AF=BC=E8=87=B4=E7=9A=84503=E9=94=99?= =?UTF-8?q?=E8=AF=AF=20(#1343)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rest/handler/loghandler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest/handler/loghandler.go b/rest/handler/loghandler.go index 57d147b8..1c428982 100644 --- a/rest/handler/loghandler.go +++ b/rest/handler/loghandler.go @@ -185,7 +185,7 @@ func logBrief(r *http.Request, code int, timer *utils.ElapsedTimer, logs *intern buf.WriteString(fmt.Sprintf("\n%s", body)) } - if ok { + if ok || r.Context().Err() == context.Canceled { logger.Info(buf.String()) } else { logger.Error(buf.String())