Commit cb3f240f authored by GuyCheung's avatar GuyCheung

add os.Chmod when create log file

parent 1fe2226c
......@@ -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
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment