Add changes to conntrackd logging

* Reduce time of storing conntrackd-stats logs
  to 1 day
* Enable conntrackd log with storing for 7 days

Change-Id: I5afc09a14c17eba4fa96ffb8f89228340c96bf67
Closes-Bug: 1466006
This commit is contained in:
Oleksiy Molchanov 2015-06-17 12:49:16 +03:00
parent be2aa0818e
commit a2a17cc181
3 changed files with 27 additions and 8 deletions

View File

@ -261,7 +261,7 @@ General {
# Logfile: on (/var/log/conntrackd.log), off, or a filename # Logfile: on (/var/log/conntrackd.log), off, or a filename
# Default: off # Default: off
# #
LogFile off LogFile on
# #
# Syslog: on, off or a facility name (daemon (default) or local0..7) # Syslog: on, off or a facility name (daemon (default) or local0..7)

View File

@ -0,0 +1,22 @@
/var/log/conntrackd-stats.log {
daily
rotate 1
missingok
copytruncate
postrotate
invoke-rc.d conntrackd restart > /dev/null
endscript
}
/var/log/conntrackd.log {
daily
rotate 7
missingok
copytruncate
postrotate
invoke-rc.d conntrackd restart > /dev/null
endscript
}

View File

@ -71,12 +71,9 @@ if $operatingsystem == 'Ubuntu' {
} }
# Workaround to ensure log is rotated properly # Workaround to ensure log is rotated properly
file_line { 'logrotate-conntrackd': file { '/etc/logrotate.d/conntrackd':
path => '/etc/logrotate.d/conntrackd', content => template('openstack/95-conntrackd.conf.erb'),
ensure => 'present',
line => ' copytruncate',
match => '^\s*copytruncate',
after => 'missingok',
require => Package[$conntrackd_package],
} }
Package[$conntrackd_package] -> File['/etc/logrotate.d/conntrackd']
} }