1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-22 22:50:50 +00:00
This commit is contained in:
Jia Li Ong 2017-06-22 18:53:29 +08:00
commit 547fbce86c
2 changed files with 2 additions and 3 deletions

View File

@ -278,10 +278,9 @@ func (w *fileLogWriter) doRotate(logTime time.Time) error {
if err != nil {
goto RESTART_LOGGER
}
//err = os.Chmod(fName, os.FileMode(0444))
err = os.Chmod(fName, os.FileMode(otherPerm))
// re-start logger
RESTART_LOGGER:
startLoggerErr := w.startLogger()

View File

@ -175,7 +175,7 @@ func TestFileRotate_06(t *testing.T) { //test file mode
log.Emergency("emergency")
rotateName := "test3" + fmt.Sprintf(".%s.%03d", time.Now().Format("2006-01-02"), 1) + ".log"
s, _ := os.Lstat(rotateName)
if s.Mode() != 0440 {
if s.Mode() != 0444 {
os.Remove(rotateName)
os.Remove("test3.log")
t.Fatal("rotate file mode error")