mirror of
https://github.com/astaxie/beego.git
synced 2025-07-06 06:50:17 +00:00
file rotate file test
This commit is contained in:
@ -267,6 +267,10 @@ func (w *fileLogWriter) deleteOldLog() {
|
||||
}
|
||||
}()
|
||||
|
||||
if info == nil {
|
||||
return
|
||||
}
|
||||
|
||||
if !info.IsDir() && info.ModTime().Add(24*time.Hour*time.Duration(w.MaxDays)).Before(time.Now()) {
|
||||
if strings.HasPrefix(filepath.Base(path), filepath.Base(w.fileNameOnly)) &&
|
||||
strings.HasSuffix(filepath.Base(path), w.suffix) {
|
||||
|
Reference in New Issue
Block a user