From ab88195d0ffa0bb690767b8ff4e4a7ba73db86f6 Mon Sep 17 00:00:00 2001 From: c-wind Date: Thu, 12 Apr 2018 14:50:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A5=E5=BF=97=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- log/writer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/log/writer.go b/log/writer.go index 69ce311..197c82b 100644 --- a/log/writer.go +++ b/log/writer.go @@ -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)