1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-22 22:10:48 +00:00

Provide permission to access old log files to everyone

This commit is contained in:
Jia Li Ong 2017-06-01 17:48:48 +08:00
parent cab8458c1c
commit 0ea34fff27
2 changed files with 2 additions and 2 deletions

View File

@ -271,7 +271,7 @@ func (w *fileLogWriter) doRotate(logTime time.Time) error {
if err != nil {
goto RESTART_LOGGER
}
err = os.Chmod(fName, os.FileMode(0440))
err = os.Chmod(fName, os.FileMode(0444))
// re-start logger
RESTART_LOGGER:

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")