Commit b28581a4 authored by JessonChan's avatar JessonChan

make daily rotate

parent fa8d94fa
......@@ -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
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment