sous-chefs / logrotate

Development repository for the logrotate cookbook

Home Page:https://supermarket.chef.io/cookbooks/logrotate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to include maxage parameter in logrotate file ?

GuptaArpit07 opened this issue · comments

Hi,
I have the logrotate cookbook which I have used in my deploy recipe to include the logrotation of log files.
Below is the blog from my file for creating the logrotate file for app logs.
logrotate_app 'app' do path ["#{node['deploy']['logdir']}/#{node['deploy']['nodejs']['application_name']}/app*log"] size '5M' frequency 'daily' rotate 5 options ['missingok', 'delaycompress', 'notifempty', 'sharedscripts', 'copytruncate'] create "664 #{node['deploy']['user']} root" end

Can you please help me in including the maxage parameter with correct syntax as I am unable to do so?
I tried adding as : -
maxage 60
maxage=>60
But the file is not getting updated after running the chef-client on the server due to some syntax mismatch.

Thanks

Hi,

maxage 60

or

maxage "60"

should work. Can you share the error message you are getting when trying to use that option?

There is no such error I am getting. But when I include the above value in the cookbook and upload it.
I run chef-client to apply the changes but the logrotate file present on the server is not getting updated with the maxage value.

If you can provide debug output from the chef-client run that would be helpful. Otherwise, I can try to reproduce it locally but not until this weekend most likely.

Marking stale due to inactivity. Remove stale label or comment or this will be closed in 7 days. Alternatively drop by the #sous-chefs channel on the Chef Community Slack and we'll be happy to help! Thanks, Sous-Chefs.

Closing due to inactivity. If this is still an issue please reopen or open another issue. Alternatively drop by the #sous-chefs channel on the Chef Community Slack and we'll be happy to help! Thanks, Sous-Chefs.