-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
add log rotation configuration for phi log #63
Conversation
README.md
Outdated
@@ -48,6 +48,8 @@ Example: | |||
```ruby | |||
PhiAttrs.configure do |conf| | |||
conf.log_path = Rails.root.join("log", "phi_access_#{Rails.env}.log") | |||
conf.log_shift_age = 10 # how many logs to keep of `log_shift_size` or frequency to rotate (daily, weekly or monthly) | |||
conf.log_shift_size = 100.megabyte # size in bytes when using `log_shift_age` as a number |
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.
I assume this needs to be plural
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.
Either works in rails.
README.md
Outdated
@@ -48,6 +48,8 @@ Example: | |||
```ruby | |||
PhiAttrs.configure do |conf| | |||
conf.log_path = Rails.root.join("log", "phi_access_#{Rails.env}.log") | |||
conf.log_shift_age = 10 # how many logs to keep of `log_shift_size` or frequency to rotate (daily, weekly or monthly) |
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.
Should include info about 0 == disabled here
@@ -2,4 +2,8 @@ | |||
|
|||
PhiAttrs.configure do |conf| | |||
conf.log_path = Rails.root.join('log', 'phi_access.log') | |||
|
|||
# Log Rotation - disabled by default | |||
conf.log_shift_age = 0 # how many logs to keep of `shift_size` |
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.
Should indicate here that 0 is "disabled"
Fixes #62 and allows rotation configuration to be passed in along with the path. Rotation is disabled by default.
For more information on the defaults see https://apidock.com/ruby/Logger/new/class