Skip to content

Commit 0d08d0b

Browse files
iQQBotroboquat
authored andcommitted
[common] Improve log time accuracy
1 parent 8bd6412 commit 0d08d0b

File tree

1 file changed

+5
-1
lines changed
  • components/common-go/log

1 file changed

+5
-1
lines changed

components/common-go/log/log.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,14 @@ func Init(service, version string, json, verbose bool) {
127127
funcName := s[len(s)-1]
128128
return funcName, fmt.Sprintf("%s:%d", path.Base(f.File), f.Line)
129129
},
130+
TimestampFormat: time.RFC3339Nano,
130131
},
131132
})
132133
} else {
133-
Log.Logger.SetFormatter(&logrus.TextFormatter{})
134+
Log.Logger.SetFormatter(&logrus.TextFormatter{
135+
TimestampFormat: time.RFC3339Nano,
136+
FullTimestamp: true,
137+
})
134138
}
135139

136140
// update default log level

0 commit comments

Comments
 (0)