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

Make log rotation configurable #211

Merged
merged 2 commits into from
Jun 29, 2023

Conversation

AndrewLest
Copy link

Pull Request (PR) description

Add log rotation parameters

This Pull Request (PR) fixes the following issues

Replaces pull request #149
Rebased the module using v5.0.0
Adding agent parameters:
logfile_rotation_interval, default = "0h"
logfile_rotation_max_size, default = "0MB"
logfile_rotation_max_archives, default = 5
I have added test data, setting these values to their default values.
Tested with bundle exec rake beaker - no errors
Tested in my environment on CentOS7, Ubuntu 18.04 & Windows 2019 - I just tested that the telegaf.conf file was updated appropriately

Comment on lines +115 to +117
$logfile_rotation_interval = '0h'
$logfile_rotation_max_size = '0MB'
$logfile_rotation_max_archives = 5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding the data here, please directly assign it in the init.pp. That enables puppet-strings to pick it up.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure that is the best way, I did it this way to be 100% consistent with the existing code, e.g. logfile.
In fact all values in init.pp reference telegraf::params

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it's the best way :) That's the standard we defined at https://voxpupuli.org/docs/reviewing_pr/ and we need to migrate the modules. We don't want more technical debt.

Comment on lines +5 to +7
telegraf::logfile_rotation_interval: "0h"
telegraf::logfile_rotation_max_size: "0MB"
telegraf::logfile_rotation_max_archives: 5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding this should not be required

@bastelfreak bastelfreak changed the title Updates for log rotation Make log rotation configureable Jun 29, 2023
@bastelfreak bastelfreak added the enhancement New feature or request label Jun 29, 2023
@bastelfreak bastelfreak merged commit 660dac5 into voxpupuli:master Jun 29, 2023
@kenyon kenyon changed the title Make log rotation configureable Make log rotation configurable Jun 29, 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

Successfully merging this pull request may close these issues.

2 participants