diff --git a/logger/wrapper/gorm_v2.go b/logger/wrapper/gorm_v2.go index dcdd1b5..f749210 100644 --- a/logger/wrapper/gorm_v2.go +++ b/logger/wrapper/gorm_v2.go @@ -32,6 +32,9 @@ func NewGormV2(loggerLevel zapcore.Level, consoleOutput bool, encoder zapcore.En if nil != err { return nil, err } + if len(traceIDField) == 0 { + traceIDField = "trace_id" + } return &Gorm{ instance: logInstance, }, nil