Skip to content

Commit ab88195

Browse files
committed
修复日志日期问题
1 parent 3f54f53 commit ab88195

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

log/writer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func (l *Logger) rotate(now time.Time) {
121121
l.out.Flush()
122122
l.file.Close()
123123

124-
oldFile := l.fileName + time.Now().Format("20060102")
124+
oldFile := l.fileName + "." + time.Now().AddDate(0, 0, -1).Format("20060102")
125125

126126
os.Rename(l.fileName, oldFile)
127127

0 commit comments

Comments
 (0)