-
-
Notifications
You must be signed in to change notification settings - Fork 120
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
Allow to manage Log4j configuration #328
Conversation
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 you add unit tests that demonstrate that this works as intended so that we can avoid regressions in the future?
No need to test for all values in the template, I guess that checking that the file is properly managed depending on the value of $manage_log4j
and that MaxFileSize / MaxBackupIndex are set to the expected values for an appender would be enough.
@smortex will do. |
@smortex could you please provide docs or examples how to test values of class parameters with rspec-puppet? I found how to test the file resource when
but I can't find ways how to test the parameters |
@smortex thanks a lot for your explanation! Looks like I didn't understand a main goal of the Unit tests. |
@smortex could you please review it? I hope we can include the changes to the new release |
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.
Looks good, I added an in-line note for some point you may want to adjust.
Can you then squash your changes in a single commit (to avoid multiple "fix" commits which make digging in the code history harder)?
Thanks!
I still see a lot of commits 😄 Your commits are interleaved with other ones in the master branch (you seem to have merged master at some point), so first rebase you changes on top of master:
You then end up with your 13 commits on top of master. Run:
This will open your editor with the commits where you can reorder / edit / reword / etc. If you just want to keep the commit message from the fist commit and squash all other commits into it, keep he first line untouched and change all other lines' "pick" to "fixup", save and exit, and you are ready to:
|
@smortex I'm sorry, but I'm not a big expert with Git :)) Now it's ok |
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.
LGTM. If nobody from voxpupuli who use this module approve and merge this, I am fine with merging this in a few days if no concerns are raised.
Thanks!
manifests/broker.pp
Outdated
String[0] $opts = $kafka::params::broker_opts, | ||
Boolean $manage_log4j = $kafka::params::manage_log4j, | ||
Pattern[/[1-9][0-9]*[KMG]B/] $log_file_size = $kafka::params::log_file_size, | ||
Integer $log_file_count = $kafka::params::log_file_count |
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.
For the integer here and in the other classes, can you enforce the minimal/maximal values?
example to allow 0 as lowest value and 10 as highest:
Integer $log_file_count = $kafka::params::log_file_count | |
Integer[0, 10] $log_file_count = $kafka::params::log_file_count |
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.
@bastelfreak Updated like Integer[1, 50] $log_file_count
…to rotate Kafka system log files.
@bastelfreak @smortex I'm sorry, but after my last changes it started two workflows and they are failed. |
A default configuration of log4j does not allow Kafka to delete old log files which were rotated.
As result it gets issues with disk space on Kafka instances.
The changes will allow to update
log4j.properties
files to change a logic of rotation for deleting old files.Customers can enable the function and customize a size which triggers rotating and a count of stored log files.
This Pull Request (PR) fixes the following issues
Fixes #200
Fixes #85