From 0af7fe03daa0b286e96d5bdd67fbdf2cfdc1973c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Thu, 13 Jan 2022 00:36:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8B=BC=E5=86=99=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logger/wrapper/gorm_v2.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logger/wrapper/gorm_v2.go b/logger/wrapper/gorm_v2.go index 9faae75..5b9214a 100644 --- a/logger/wrapper/gorm_v2.go +++ b/logger/wrapper/gorm_v2.go @@ -168,7 +168,7 @@ func (g *Gorm) write(dataList []zap.Field, level string) { // 补齐 flag、node sql := g.dbClient.Dialector.Explain(g.dbClient.Statement.SQL.String(), g.dbClient.Statement.Vars...) affectRows := g.dbClient.RowsAffected - dataList = append(dataList, zap.String("db_node", g.node), zap.String("db_flag", g.flag), zap.String("execute_sql", sql), zap.Int64("affext_rows", affectRows)) + dataList = append(dataList, zap.String("db_node", g.node), zap.String("db_flag", g.flag), zap.String("execute_sql", sql), zap.Int64("affect_rows", affectRows)) message := "SQL执行记录" switch strings.ToLower(level) { case "info":