Enable gerritbot logging to /var/log/gerritbot.

Configure gerritbot to log into /var/log/gerritbot.

Change-Id: I24f8602eaa0f779de9d455cda8ad692f932ebd39
Reviewed-on: https://review.openstack.org/11939
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
This commit is contained in:
Clark Boylan 2012-08-24 10:36:04 -07:00 committed by Jenkins
parent bd399216f1
commit 7398b4b0d0
3 changed files with 62 additions and 0 deletions

View File

@ -0,0 +1,44 @@
[loggers]
keys=root,gerrit,gerritbot
[handlers]
keys=console,debug,normal
[formatters]
keys=simple
[logger_root]
level=WARNING
handlers=console
[logger_gerrit]
level=DEBUG
handlers=debug,normal
qualname=gerrit
[logger_gerritbot]
level=DEBUG
handlers=debug,normal
qualname=gerritbot
[handler_console]
level=WARNING
class=StreamHandler
formatter=simple
args=(sys.stdout,)
[handler_debug]
level=DEBUG
class=logging.handlers.TimedRotatingFileHandler
formatter=simple
args=('/var/log/gerritbot/gerritbot_debug.log', 'midnight', 1, 30,)
[handler_normal]
level=INFO
class=logging.handlers.TimedRotatingFileHandler
formatter=simple
args=('/var/log/gerritbot/gerritbot.log', 'midnight', 1, 30,)
[formatter_simple]
format=%(asctime)s %(levelname)s %(name)s: %(message)s
datefmt=

View File

@ -38,6 +38,13 @@ class gerritbot(
ensure => directory
}
file { '/var/log/gerritbot':
ensure => directory,
owner => 'root',
group => 'gerrit2',
mode => 0775,
}
file { '/etc/gerritbot/channel_config.yaml':
owner => 'root',
group => 'gerrit2',
@ -48,6 +55,16 @@ class gerritbot(
require => User['gerrit2'],
}
file { '/etc/gerritbot/logging.config':
owner => 'root',
group => 'gerrit2',
mode => 440,
ensure => 'present',
source => 'puppet:///modules/gerritbot/logging.config',
replace => true,
require => User['gerrit2'],
}
file { '/etc/gerritbot/gerritbot.config':
owner => 'root',
group => 'gerrit2',

View File

@ -5,6 +5,7 @@ server=<%= server %>
port=6667
channel_config=/etc/gerritbot/channel_config.yaml
lockfile=/var/run/gerritbot/gerritbot.pid
log_config=/etc/gerritbot/logging.config
[gerrit]
user=<%= user %>