mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 19:41:00 +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.dailyOpenTime = time.Now()
|
||||||
w.dailyOpenDate = w.dailyOpenTime.Day()
|
w.dailyOpenDate = w.dailyOpenTime.Day()
|
||||||
w.maxLinesCurLines = 0
|
w.maxLinesCurLines = 0
|
||||||
|
if w.Daily {
|
||||||
|
go w.dailyRotate(w.dailyOpenTime)
|
||||||
|
}
|
||||||
if fInfo.Size() > 0 {
|
if fInfo.Size() > 0 {
|
||||||
count, err := w.lines()
|
count, err := w.lines()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -174,9 +177,6 @@ func (w *fileLogWriter) initFd() error {
|
|||||||
}
|
}
|
||||||
w.maxLinesCurLines = count
|
w.maxLinesCurLines = count
|
||||||
}
|
}
|
||||||
if w.Daily {
|
|
||||||
go w.dailyRotate(w.dailyOpenTime)
|
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user