Skip to content
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

如何设置创建的 log 文件的权限?默认是 0644,如何改为 0600 或 0700? #102

Closed
iredmail opened this issue May 24, 2023 · 5 comments
Assignees
Labels
question Further information is requested resolved suggestion

Comments

@iredmail
Copy link

使用最新版本的 slog 库,但没找到如何指定创建的 log 文件的权限。
默认是 0644,前面的 6 和 4 都还好,但最后一个 4 导致除了 owner/group 外的人也可以查看文件内容,这个不是很理想。
如何改为 0600 或 0700?

@inhere
Copy link
Member

inhere commented May 24, 2023

默认是 rotatefile.DefaultFilePerm os.FileMode = 0664

是包 rotatefile 的全局变量,可以设置改变它

@inhere inhere added the question Further information is requested label May 24, 2023
@iredmail
Copy link
Author

改用 WithXXX() 来修改是不是更好点?

@inhere
Copy link
Member

inhere commented May 26, 2023

可以后续加个配置项 👍

@iredmail
Copy link
Author

可以后续加个配置项 👍

请帮忙 review PR #103

@inhere
Copy link
Member

inhere commented Jun 19, 2023

已经跟随 v0.5.2 发布调整了,新增了选项设置。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested resolved suggestion
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants