Skip to content

Commit

Permalink
Merge pull request #59 from redBorder/bugfix/#18277_add_logrotate_to_…
Browse files Browse the repository at this point in the history
…logstash

Bugfix/#18277 add logrotate to logstash
  • Loading branch information
nilsver authored Oct 31, 2024
2 parents baf2cbe + 4cd16dc commit ef1f487
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
8 changes: 8 additions & 0 deletions resources/recipes/prepare_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@
)
end

template '/etc/logrotate.d/logstash' do
source 'logstash_log-rotate.erb'
owner 'root'
group 'root'
mode 0644
retries 2
end

service 'chef-client' do
if node['redborder']['services']['chef-client']
action [:enable, :start]
Expand Down
16 changes: 16 additions & 0 deletions resources/templates/default/logstash_log-rotate.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
###############################################################################
# Generated by Chef #
###############################################################################

/var/log/logstash/*.log {
size=20M
missingok
rotate 5
compress
delaycompress
notifempty
copytruncate
postrotate
rm -f /var/log/logstash/*.gz > /dev/null
endscript
}

0 comments on commit ef1f487

Please sign in to comment.