Skip to content

Commit

Permalink
修复日志日期问题
Browse files Browse the repository at this point in the history
  • Loading branch information
c-wind committed Apr 12, 2018
1 parent 3f54f53 commit ab88195
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion log/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func (l *Logger) rotate(now time.Time) {
l.out.Flush()
l.file.Close()

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

os.Rename(l.fileName, oldFile)

Expand Down

0 comments on commit ab88195

Please sign in to comment.