1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 08:50:56 +00:00

if exist file then read lines err

This commit is contained in:
astaxie 2013-06-25 11:19:03 +08:00
parent d99ae3e3a2
commit 23ff422826

4
log.go
View File

@ -139,9 +139,9 @@ func (w *FileLogWriter) DoRotate(rotate bool) error {
w.maxsize_cursize = int(finfo.Size())
w.daily_opendate = time.Now().Day()
if finfo.Size() > 0 {
content, err := ioutil.ReadAll(fd)
content, err := ioutil.ReadFile(w.filename)
if err != nil {
//Do something
fmt.Println(err)
}
w.maxlines_curlines = len(strings.Split(string(content), "\n"))