mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 08:10:58 +00:00
make daily rotate
This commit is contained in:
parent
fa8d94fa69
commit
b28581a463
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user