gorm日志增加默认的trace_id field

This commit is contained in:
zhangdeman committed 2021-03-05 00:02:58 +08:00
1 parent e655c031b2
commit 9b861374e3
1 file changed
+3
+3
View File
@@ -32,6 +32,9 @@ func NewGormV2(loggerLevel zapcore.Level, consoleOutput bool, encoder zapcore.En
if nil != err { if nil != err {
return nil, err return nil, err
} }
if len(traceIDField) == 0 {
traceIDField = "trace_id"
}
return &Gorm{ return &Gorm{
instance: logInstance, instance: logInstance,
}, nil }, nil
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.