mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 09:50:56 +00:00
add w.Rotate
This commit is contained in:
parent
d79c297880
commit
ff1938054a
@ -118,9 +118,9 @@ func (w *FileLogWriter) StartLogger() error {
|
|||||||
func (w *FileLogWriter) docheck(size int) {
|
func (w *FileLogWriter) docheck(size int) {
|
||||||
w.startLock.Lock()
|
w.startLock.Lock()
|
||||||
defer w.startLock.Unlock()
|
defer w.startLock.Unlock()
|
||||||
if (w.Maxlines > 0 && w.maxlines_curlines >= w.Maxlines) ||
|
if w.Rotate && ((w.Maxlines > 0 && w.maxlines_curlines >= w.Maxlines) ||
|
||||||
(w.Maxsize > 0 && w.maxsize_cursize >= w.Maxsize) ||
|
(w.Maxsize > 0 && w.maxsize_cursize >= w.Maxsize) ||
|
||||||
(w.Daily && time.Now().Day() != w.daily_opendate) {
|
(w.Daily && time.Now().Day() != w.daily_opendate)) {
|
||||||
if err := w.DoRotate(); err != nil {
|
if err := w.DoRotate(); err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "FileLogWriter(%q): %s\n", w.Filename, err)
|
fmt.Fprintf(os.Stderr, "FileLogWriter(%q): %s\n", w.Filename, err)
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user