![Bartłomiej Piotrowski](/assets/img/avatar_default.png)
- instead of rotating logs daily and weekly, run the script every 15 minutes - merge weekly and daily configuration files - rotate logs basing on two criteria: age (a week; only if file is bigger than 10M on master or 5MB on remote nodes) and size (rotate the file always if its size exceedes 100M on master or 20M on remote nodes, regardless its age) - use dateformat to make rotated logs' filenames more readable; as logrotate supports only year, month, day and unix epoch, use them all - fix a lot of lint complaints, including aligments, curly braces and proper quoting; give logrotate related files more intuitive names - dump.log has been renamed to shotgun.log (LP#1318516) - check if there is no logrotate instances running before executing cronjob DocImpact: ops guide Change-Id: Ie7040ebcdc1a3329ebb7507807e5c27f0c87b484 Closes-Bug: 1382515 Closes-Bug: 1446790
53 lines
1.5 KiB
Puppet
53 lines
1.5 KiB
Puppet
notice('MODULAR: logging.pp')
|
|
|
|
$base_syslog_hash = hiera('base_syslog_hash')
|
|
$syslog_hash = hiera('syslog_hash')
|
|
$use_syslog = hiera('use_syslog', true)
|
|
$debug = hiera('debug', false)
|
|
|
|
##################################################
|
|
|
|
$base_syslog_rserver = {
|
|
'remote_type' => 'tcp',
|
|
'server' => $base_syslog_hash['syslog_server'],
|
|
'port' => $base_syslog_hash['syslog_port']
|
|
}
|
|
|
|
$syslog_rserver = {
|
|
'remote_type' => $syslog_hash['syslog_transport'],
|
|
'server' => $syslog_hash['syslog_server'],
|
|
'port' => $syslog_hash['syslog_port'],
|
|
}
|
|
|
|
if ($syslog_hash['syslog_server'] != ''
|
|
and $syslog_hash['syslog_port'] != ''
|
|
and $syslog_hash['syslog_transport'] != '') {
|
|
$rservers = [$base_syslog_rserver, $syslog_rserver]
|
|
} else {
|
|
$rservers = [$base_syslog_rserver]
|
|
}
|
|
|
|
if $use_syslog {
|
|
class { '::openstack::logging':
|
|
role => 'client',
|
|
show_timezone => true,
|
|
# log both locally include auth, and remote
|
|
log_remote => true,
|
|
log_local => true,
|
|
log_auth_local => true,
|
|
# keep four weekly log rotations,
|
|
# force rotate if 300M size have exceeded
|
|
rotation => 'weekly',
|
|
keep => '4',
|
|
minsize => '10M',
|
|
maxsize => '100M',
|
|
# remote servers to send logs to
|
|
rservers => $rservers,
|
|
# should be true, if client is running at virtual node
|
|
virtual => str2bool($::is_virtual),
|
|
# Rabbit doesn't support syslog directly
|
|
rabbit_log_level => 'NOTICE',
|
|
debug => $debug,
|
|
}
|
|
}
|