natefinch / lumberjack

lumberjack is a log rolling package for Go
MIT License
4.79k stars 591 forks source link

use 0755 to create new dir #68

Closed caibirdme closed 5 years ago

caibirdme commented 5 years ago

Use Case:

Application is running in production with user A, but when debugging I use user B to login on that machine, but 0744 prevent me from scanning files in the dir which is created by lumberjack. 0755 would be better

natefinch commented 5 years ago

so... you can set the mode on the directory.. just create it yourself before starting lumberjack... mkdirall won't change the permissions if it's already there.

I don't really want to create a universally readable directory for logs on the off chance there's anything secret logged in there. But if you want to do that for your case, you can do that without this PR.

caibirdme commented 5 years ago

I understand that, but it's very often to allow user to configure where they want to log, which means they have to create those directories in advance if they use a different account in some environments(production preview test). I can make a easy workaround for that case, it's not a problem, but the thing is that I don't know the advantages 0744 has over 0755

natefinch commented 5 years ago

Sorry, this was a brainfart on my part. I was thinking you were asking to make the directory writable. 755 is correct to allow people to list the contents of the directory.