-
Notifications
You must be signed in to change notification settings - Fork 597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can support custom file permissions? #164
Comments
Lumberjack will copy the permissions of the existing file when it creates the new file. So if you want different file permissions, the easiest thing to do is create the file with the permissions you want, first. |
@natefinch But the file is generated by calling the |
If you create the file in your own code with the right permissions, lumberjack will copy those permissions to the new file when it rolls over. It creates the file with default permissions and then changes those permissions to match the permissions on the previous file. |
There are many people have the requirement to custom the permission of the log file or even the log dir @machine3 . I can push a PR to custom the permission with addition mode parameter for this requirement, and I want to make sure if you support this change。@natefinch |
What would it do if the file already exists with different permissions? Would it try to change the permissions on the existing file? If not, would it use the existing file's permissions on the new file when it rolls over, or would it use the configured permissions? I think it's easier to just let the program code create the file with the permissions it prefers, and then lumberjack will respect those permissions. If you don't have a file created, lumberjack tries to use sensible defaults, but also obvious can't please everyone. |
Everything else remains the same, I just think this |
Clunky workaround for natefinch/lumberjack#164
This would be nice to have. The PR appears pretty good. #168 |
+1 on this PR |
+1 on this. It would be excellent to provide the desired octal perms vs touch a file in code, with the desired perms, if the file doesn't stat. |
Would also like to have this PR. #168 |
https://github.com/natefinch/lumberjack/blob/v3/lumberjack.go#L255
I want to replace 600 with 644
The text was updated successfully, but these errors were encountered: