cihub / seelog

Seelog is a native Go logging library that provides flexible asynchronous dispatching, filtering, and formatting.
BSD 3-Clause "New" or "Revised" License
1.64k stars 244 forks source link

How to change file permissions for log file #138

Open nehalkassem opened 7 years ago

nehalkassem commented 7 years ago

How can i change the file permissions for the generated log files? Example make it 0700 or 0600

pkorotkov commented 7 years ago

Hi @nehalkassem Currently file/directory permissions are hardcoded and not intended to be modified from outside. I suggest a straightforward solution: use OS utils (like Unix chmod) for freshly generated log files. Does it work for you?

nehalkassem commented 7 years ago

Thank you for getting back to me, I use the rollingwriter so this will generate files and I have no control on when the files gets generated. i tried to change the hardcoded file permission value but that didn't change anything. Can you please tell me where are the places that has the file permissions set? All I found is in internals_fsutils.go constant defaultFilePermissions

pkorotkov commented 7 years ago

@nehalkassem Seelog's internals_fsutils.go is really the only place where those settings reside. Since you played around file permissions with no-good, I can also recommend you to check system umask.