Deploy `/etc/logrotate.d/alertmanager`.

This commit is contained in:
Kazuhiro MUSASHI 2023-02-16 21:29:32 +09:00
parent 970a9617eb
commit 1e31bff167
3 changed files with 27 additions and 0 deletions

View File

@ -54,6 +54,13 @@ service 'rsyslog' do
action :nothing action :nothing
end end
# Deploy `logroted` config for `alertmanager`:
remote_file '/etc/logrotate.d/alertmanager' do
owner 'root'
group 'root'
mode '644'
end
# Firewall settings here: # Firewall settings here:
%w( 9093/tcp ).each do |p| %w( 9093/tcp ).each do |p|
execute "ufw allow #{p}" do execute "ufw allow #{p}" do

View File

@ -0,0 +1,13 @@
/var/log/alertmanager.log
{
rotate 4
weekly
missingok
notifempty
compress
delaycompress
sharedscripts
postrotate
/usr/lib/rsyslog/rsyslog-rotate
endscript
}

View File

@ -0,0 +1,7 @@
# Log kernel generated digdag log messages to file
:syslogtag,contains,"alertmanager" /var/log/alertmanager.log
# Uncomment the following to stop logging anything that matches the last rule.
# Doing this will stop logging kernel generated UFW log messages to the file
# normally containing kern.* messages (eg, /var/log/kern.log)
& stop