Unverified Commit 3b829504 authored by astaxie's avatar astaxie Committed by GitHub

Merge pull request #2920 from chenpeiyuan/develop

avoid unnecessary read of large log file
parents e211e483 80fa5146
......@@ -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
......
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