BBlack has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/257208

Change subject: pybal: persist journal logs to disk
......................................................................

pybal: persist journal logs to disk

Currently the pybal service logs directly to the systemd journal
via stdio, and then isn't persisted to actual log files.  This
persists the log data to /var/log/pybal.log with daily logrotate
and 15 days of history.

Change-Id: Iec425f7866ee3e596e5eb5f4a388de46a798fe12
---
A modules/pybal/files/pybal.logrotate.conf
A modules/pybal/files/pybal.rsyslog.conf
M modules/pybal/manifests/init.pp
3 files changed, 28 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/08/257208/1

diff --git a/modules/pybal/files/pybal.logrotate.conf 
b/modules/pybal/files/pybal.logrotate.conf
new file mode 100644
index 0000000..dbe9edd
--- /dev/null
+++ b/modules/pybal/files/pybal.logrotate.conf
@@ -0,0 +1,12 @@
+/var/log/pybal.log
+{
+    rotate 15
+    daily
+    missingok
+    notifempty
+    delaycompress
+    compress
+    postrotate
+        reload rsyslog >/dev/null 2>&1 || true
+    endscript
+}
diff --git a/modules/pybal/files/pybal.rsyslog.conf 
b/modules/pybal/files/pybal.rsyslog.conf
new file mode 100644
index 0000000..6c46d20
--- /dev/null
+++ b/modules/pybal/files/pybal.rsyslog.conf
@@ -0,0 +1,4 @@
+# NOTE: This file is managed by Puppet.
+
+# rsyslogd varnishkafka config.
+if $programname == 'pybal' then /var/log/pybal.log
diff --git a/modules/pybal/manifests/init.pp b/modules/pybal/manifests/init.pp
index 15bf69a..e6c0154 100644
--- a/modules/pybal/manifests/init.pp
+++ b/modules/pybal/manifests/init.pp
@@ -17,6 +17,18 @@
         require => File['/etc/default/pybal'],
     }
 
+    rsyslog::conf { 'pybal':
+        source   => 'puppet:///modules/pybal/pybal.rsyslog.conf',
+        priority => 75,
+        before   => Service['pybal'],
+    }
+
+    file { '/etc/logrotate.d/pybal':
+        ensure => present,
+        source => 'puppet:///modules/pybal/pybal.logrotate.conf',
+        mode   => '0444',
+    }
+
     nrpe::monitor_service { 'pybal':
         description  => 'pybal',
         nrpe_command => '/usr/lib/nagios/plugins/check_procs -c 1:1 -u root -a 
/usr/sbin/pybal',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iec425f7866ee3e596e5eb5f4a388de46a798fe12
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack <bbl...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to