1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-22 23:00:50 +00:00

make daily rotate

This commit is contained in:
JessonChan 2016-05-06 12:11:14 +08:00
parent fa8d94fa69
commit b28581a463

View File

@ -167,6 +167,9 @@ func (w *fileLogWriter) initFd() error {
w.dailyOpenTime = time.Now()
w.dailyOpenDate = w.dailyOpenTime.Day()
w.maxLinesCurLines = 0
if w.Daily {
go w.dailyRotate(w.dailyOpenTime)
}
if fInfo.Size() > 0 {
count, err := w.lines()
if err != nil {
@ -174,9 +177,6 @@ func (w *fileLogWriter) initFd() error {
}
w.maxLinesCurLines = count
}
if w.Daily {
go w.dailyRotate(w.dailyOpenTime)
}
return nil
}