diff --git a/modules/elastic_recheck/files/elastic-recheck.init b/modules/elastic_recheck/files/elastic-recheck.init index 657a94fec6..d32eaaf2ce 100644 --- a/modules/elastic_recheck/files/elastic-recheck.init +++ b/modules/elastic_recheck/files/elastic-recheck.init @@ -134,7 +134,7 @@ case "$1" in esac ;; *) - # Failed to stop + # Failed to stop log_end_msg 1 ;; esac diff --git a/modules/elastic_recheck/files/logging.config b/modules/elastic_recheck/files/logging.config new file mode 100644 index 0000000000..a1b4c8c90d --- /dev/null +++ b/modules/elastic_recheck/files/logging.config @@ -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= diff --git a/modules/elastic_recheck/manifests/init.pp b/modules/elastic_recheck/manifests/init.pp index 6a84c55cc1..27c3fb1bff 100644 --- a/modules/elastic_recheck/manifests/init.pp +++ b/modules/elastic_recheck/manifests/init.pp @@ -87,6 +87,15 @@ class 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': ensure => present, mode => '0640', diff --git a/modules/elastic_recheck/templates/elastic-recheck.conf.erb b/modules/elastic_recheck/templates/elastic-recheck.conf.erb index 92c4837caa..b363968412 100644 --- a/modules/elastic_recheck/templates/elastic-recheck.conf.erb +++ b/modules/elastic_recheck/templates/elastic-recheck.conf.erb @@ -5,6 +5,7 @@ pass=<%= recheck_bot_passwd %> server=irc.freenode.net port=6667 channel_config=/etc/elastic-recheck/recheckwatchbot.yaml +log_config=/etc/elastic-recheck/logging.config [gerrit] user=<%= gerrit_user %>