Merge "Rotate zuul logs with logrotate"

This commit is contained in:
James E. Blair 2014-05-27 21:46:30 +00:00 committed by Gerrit Code Review
commit fd66afe4c0
5 changed files with 74 additions and 10 deletions

View File

@ -24,9 +24,9 @@ args=(sys.stdout,)
[handler_normal]
level=INFO
class=logging.handlers.TimedRotatingFileHandler
class=logging.handlers.FileHandler
formatter=simple
args=('/var/log/zuul/gearman-server.log', 'midnight', 1, 3,)
args=('/var/log/zuul/gearman-server.log')
[formatter_simple]
format=%(asctime)s %(levelname)s %(name)s: %(message)s

View File

@ -34,15 +34,15 @@ args=(sys.stdout,)
[handler_debug]
level=DEBUG
class=logging.handlers.TimedRotatingFileHandler
class=logging.handlers.FileHandler
formatter=simple
args=('/var/log/zuul/debug.log', 'midnight', 1, 30,)
args=('/var/log/zuul/debug.log')
[handler_normal]
level=INFO
class=logging.handlers.TimedRotatingFileHandler
class=logging.handlers.FileHandler
formatter=simple
args=('/var/log/zuul/zuul.log', 'midnight', 1, 30,)
args=('/var/log/zuul/zuul.log')
[formatter_simple]
format=%(asctime)s %(levelname)s %(name)s: %(message)s

View File

@ -34,15 +34,15 @@ args=(sys.stdout,)
[handler_debug]
level=DEBUG
class=logging.handlers.TimedRotatingFileHandler
class=logging.handlers.FileHandler
formatter=simple
args=('/var/log/zuul/merger-debug.log', 'midnight', 1, 30,)
args=('/var/log/zuul/merger-debug.log')
[handler_normal]
level=INFO
class=logging.handlers.TimedRotatingFileHandler
class=logging.handlers.FileHandler
formatter=simple
args=('/var/log/zuul/merger.log', 'midnight', 1, 30,)
args=('/var/log/zuul/merger.log')
[formatter_simple]
format=%(asctime)s %(levelname)s %(name)s: %(message)s

View File

@ -33,4 +33,30 @@ class zuul::merger (
require => [User['zuul'],
File['/var/lib/zuul/git']],
}
include logrotate
logrotate::file { 'merger.log':
log => '/var/log/zuul/merger.log',
options => [
'compress',
'copytruncate',
'missingok',
'rotate 30',
'daily',
'notifempty',
],
require => Service['zuul-merger'],
}
logrotate::file { 'merger-debug.log':
log => '/var/log/zuul/merger-debug.log',
options => [
'compress',
'copytruncate',
'missingok',
'rotate 30',
'daily',
'notifempty',
],
require => Service['zuul-merger'],
}
}

View File

@ -29,4 +29,42 @@ class zuul::server (
require => File['/etc/init.d/zuul'],
refreshonly => true,
}
include logrotate
logrotate::file { 'zuul.log':
log => '/var/log/zuul/zuul.log',
options => [
'compress',
'copytruncate',
'missingok',
'rotate 30',
'daily',
'notifempty',
],
require => Service['zuul'],
}
logrotate::file { 'zuul-debug.log':
log => '/var/log/zuul/debug.log',
options => [
'compress',
'copytruncate',
'missingok',
'rotate 30',
'daily',
'notifempty',
],
require => Service['zuul'],
}
logrotate::file { 'gearman-server.log':
log => '/var/log/zuul/gearman-server.log',
options => [
'compress',
'copytruncate',
'missingok',
'rotate 7',
'daily',
'notifempty',
],
require => Service['zuul'],
}
}