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

Configurable file permissions #51

Open
johnabass opened this issue Mar 30, 2023 · 0 comments
Open

Configurable file permissions #51

johnabass opened this issue Mar 30, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@johnabass
Copy link
Collaborator

johnabass commented Mar 30, 2023

Add configurable, nix-style file permissions for log files in both the standard and custom lumberjack sinks. This involves several items:

(1) Added a Permissions string field to sallust.Config. This field will have the same format as nix-style permissions, allowing a leading zero, e.g. "0644" and "644" are both acceptable. sallust will then parse that into an fs.FileMode.

(2) Add code that happens before the standard zap.Sink that creates the file with the configured permissions. This will probably have to happen in sallust.Config.Build(...).

(3) Include a perms=xyz parameter in the lumberjack URI for the sallust.Lumberjack type. This URI parameter's value has the same format(s) as in (1) above. This is required so that configuration information carries down to the custom code in sallust.NewLumberJackSink. See: https://pkg.go.dev/github.com/xmidt-org/sallust#NewLumberjackSink

@johnabass johnabass added the enhancement New feature or request label Mar 30, 2023
@johnabass johnabass self-assigned this Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant