From b788d74fd1bd1f6300b7923d3e4455bc165339cf Mon Sep 17 00:00:00 2001 From: codejuan Date: Tue, 6 Dec 2016 12:44:00 +0800 Subject: [PATCH] set perm of rotated log to 440 --- logs/file.go | 1 + 1 file changed, 1 insertion(+) diff --git a/logs/file.go b/logs/file.go index 42146dae..bd3c22a9 100644 --- a/logs/file.go +++ b/logs/file.go @@ -270,6 +270,7 @@ func (w *fileLogWriter) doRotate(logTime time.Time) error { // Rename the file to its new found name // even if occurs error,we MUST guarantee to restart new logger err = os.Rename(w.Filename, fName) + err = os.Chmod(fName, os.FileMode(440)) // re-start logger RESTART_LOGGER: