diff --git a/logs/file.go b/logs/file.go index e8c1f37e..8e5117d2 100644 --- a/logs/file.go +++ b/logs/file.go @@ -182,7 +182,7 @@ func (w *fileLogWriter) initFd() error { if w.Daily { go w.dailyRotate(w.dailyOpenTime) } - if fInfo.Size() > 0 { + if fInfo.Size() > 0 && w.MaxLines > 0 { count, err := w.lines() if err != nil { return err