Turn on logging for elastic-recheck

* modules/elastic_recheck/files/elastic-recheck.init: Minor
whitespace cleanup for space-before-tab indent on a comment line.

* modules/elastic_recheck/files/logging.config: New logging
configuration file for elastic-recheck IRC bot.

* modules/elastic_recheck/manifests/init.pp: Install the new logging
configuration file.

* modules/elastic_recheck/templates/elastic-recheck.conf.erb: Tell
the IRC bot to use the new logging configuration file.

Change-Id: I47cabb01df209c9f020846bcb272b9a2f796b0e5
This commit is contained in:
Jeremy Stanley 2013-09-30 20:58:57 +00:00 committed by James E. Blair
parent 942e5f1dfb
commit d1bd696b56
4 changed files with 63 additions and 1 deletions

View File

@ -0,0 +1,52 @@
[loggers]
keys=root,recheckwatchbot,elastic-recheck,irc
[handlers]
keys=console,debug,normal
[formatters]
keys=simple
[logger_root]
level=INFO
handlers=console,debug,normal
[logger_elastic-recheck]
level=DEBUG
handlers=console,debug,normal
qualname=elastic-recheck
propagate=0
[logger_recheckwatchbot]
level=DEBUG
handlers=console,debug,normal
qualname=elastic-recheck
propagate=0
[logger_irc]
level=INFO
handlers=console,debug,normal
qualname=irc
propagate=0
[handler_console]
level=WARNING
class=StreamHandler
formatter=simple
args=(sys.stdout,)
[handler_debug]
level=DEBUG
class=logging.handlers.TimedRotatingFileHandler
formatter=simple
args=('/var/log/elastic-recheck/elastic-recheck_debug.log', 'midnight', 1, 30,)
[handler_normal]
level=INFO
class=logging.handlers.TimedRotatingFileHandler
formatter=simple
args=('/var/log/elastic-recheck/elastic-recheck.log', 'midnight', 1, 30,)
[formatter_simple]
format=%(asctime)s %(levelname)s %(name)s: %(message)s
datefmt=

View File

@ -87,6 +87,15 @@ class elastic_recheck (
require => File['/etc/elastic-recheck'], require => File['/etc/elastic-recheck'],
} }
file { '/etc/elastic-recheck/logging.config':
ensure => present,
mode => '0640',
owner => 'recheck',
group => 'recheck',
source => 'puppet:///modules/elastic_recheck/logging.config',
require => File['/etc/elastic-recheck'],
}
file { '/etc/elastic-recheck/recheckwatchbot.yaml': file { '/etc/elastic-recheck/recheckwatchbot.yaml':
ensure => present, ensure => present,
mode => '0640', mode => '0640',

View File

@ -5,6 +5,7 @@ pass=<%= recheck_bot_passwd %>
server=irc.freenode.net server=irc.freenode.net
port=6667 port=6667
channel_config=/etc/elastic-recheck/recheckwatchbot.yaml channel_config=/etc/elastic-recheck/recheckwatchbot.yaml
log_config=/etc/elastic-recheck/logging.config
[gerrit] [gerrit]
user=<%= gerrit_user %> user=<%= gerrit_user %>