mirror of
https://github.com/astaxie/beego.git
synced 2024-12-22 22:10:48 +00:00
add os.Chmod when create log file
This commit is contained in:
parent
1fe2226c11
commit
cb3f240f44
@ -159,6 +159,10 @@ func (w *fileLogWriter) createLogFile() (*os.File, error) {
|
||||
return nil, err
|
||||
}
|
||||
fd, err := os.OpenFile(w.Filename, os.O_WRONLY|os.O_APPEND|os.O_CREATE, os.FileMode(perm))
|
||||
if err == nil {
|
||||
// Make sure file perm is user set perm cause of `os.OpenFile` will obey umask
|
||||
os.Chmod(w.Filename, w.Perm)
|
||||
}
|
||||
return fd, err
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user