-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
logging: Customize log file permissions (#6314)
Adding a "mode" option to overwrite the default logfile permissions. Default remains "0600" which is the one currently used by lumberjack.
- Loading branch information
Showing
3 changed files
with
426 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
101d3e7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use this mode with Caddyfile now? I tried add { mode 644 } then validate the config:
Error: setting up default log: loading log writer module: loading module 'file': decoding module config: caddy.logging.writers.file: json: cannot unmarshal number into Go struct field FileWriter.mode of type string
101d3e7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ririsoft Is this something you can reproduce? I haven't had a chance to test it
101d3e7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I can reproduce.
I did full end to end testing when I only implemented the CaddyFile config.
I then added support for JSON but did not do full end to end testing again, assuming the unittests were enough.
I am really sorry about that.
I was missing an implementation of
MarshallJson
since I only implementedUnMarshalJSON
.Shall I submit a new PR to fix it or you want a revert first ?
101d3e7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just fix it. We don't provide any guarantees about the master branch.
101d3e7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#6383 should fix it.
101d3e7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the high-quality contribution! And patch :)