Ottomata has submitted this change and it was merged.

Change subject: Parameterize eventlogging-service access log level so labs can 
make this more verbose
......................................................................


Parameterize eventlogging-service access log level so labs can make this more 
verbose

Change-Id: I66caa2ced7ef3bdcd798e51e8d54864a2cdd4cca
---
M modules/eventlogging/manifests/service/service.pp
M modules/eventlogging/templates/log.cfg.erb
M modules/role/manifests/eventbus/eventbus.pp
3 files changed, 20 insertions(+), 8 deletions(-)

Approvals:
  Ottomata: Verified; Looks good to me, approved



diff --git a/modules/eventlogging/manifests/service/service.pp 
b/modules/eventlogging/manifests/service/service.pp
index fec813f..729379b 100644
--- a/modules/eventlogging/manifests/service/service.pp
+++ b/modules/eventlogging/manifests/service/service.pp
@@ -28,6 +28,10 @@
 #   Output log file for this service.
 #   Default: $eventlogging::log_dir/eventlogging-service-${basename}.log
 #
+# [*access_log_level*]
+#   Log level for access request logging.  Default: WARNING, which will
+#   not log 2xx requests.  If you want 2xx requests, set this to INFO.
+#
 # [*log_config_template*]
 #   Path to ERb template to reconfigure logging.  You probably don't need to
 #   change this.  Default: eventlogging/log.cfg.erb
@@ -45,6 +49,7 @@
     $port                = 8085,
     $num_processes       = undef, # default 1
     $log_file            = undef,
+    $access_log_level    = 'WARNING',
     $log_config_template = 'eventlogging/log.cfg.erb',
     $statsd              = 'localhost:8125',
     $statsd_prefix       = "eventlogging.service.${title}",
diff --git a/modules/eventlogging/templates/log.cfg.erb 
b/modules/eventlogging/templates/log.cfg.erb
index c78da1a..2f80025 100644
--- a/modules/eventlogging/templates/log.cfg.erb
+++ b/modules/eventlogging/templates/log.cfg.erb
@@ -30,7 +30,7 @@
 handlers=
 
 [logger_tornado_access]
-level=WARNING
+level=<%= @access_log_level ? @access_log_level : 'WARNING' %>
 qualname=tornado.access
 handlers=
 
diff --git a/modules/role/manifests/eventbus/eventbus.pp 
b/modules/role/manifests/eventbus/eventbus.pp
index e2b64cb..53468ca 100644
--- a/modules/role/manifests/eventbus/eventbus.pp
+++ b/modules/role/manifests/eventbus/eventbus.pp
@@ -43,18 +43,25 @@
         "${kafka_base_uri}?async=False&topic=${::site}.{meta[topic]}"
     ]
 
+
+    $access_log_level = $::realm ? {
+        'production' => 'WARNING',
+        default      => 'INFO',
+    }
+
     # TODO: Allow configuration of more than one service daemon process?
     eventlogging::service::service { 'eventbus':
-        schemas_path  => "${::eventschemas::path}/jsonschema",
-        topic_config  => "${::eventschemas::path}/config/eventbus-topics.yaml",
-        outputs       => $outputs,
-        statsd        => hiera('statsd'),
-        statsd_prefix => 'eventbus',
+        schemas_path     => "${::eventschemas::path}/jsonschema",
+        topic_config     => 
"${::eventschemas::path}/config/eventbus-topics.yaml",
+        outputs          => $outputs,
+        statsd           => hiera('statsd'),
+        statsd_prefix    => 'eventbus',
         # The service will be reloaded (SIGHUPed, not restarted)
         # if any of these resources change.
         # Reload if mediawiki/event-schemas has a change.
-        reload_on     =>  Class['::eventschemas'],
-        num_processes => 8,
+        reload_on        =>  Class['::eventschemas'],
+        num_processes    => 8,
+        access_log_level => $access_log_level
     }
 
     # Allow traffic to eventlogging-service on $port

-- 
To view, visit https://gerrit.wikimedia.org/r/302282
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I66caa2ced7ef3bdcd798e51e8d54864a2cdd4cca
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ottomata <[email protected]>
Gerrit-Reviewer: Ottomata <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to