From bb07407485ed1626221a1190cc2fb2789f95ed22 Mon Sep 17 00:00:00 2001 From: elijah Date: Wed, 15 Apr 2015 16:12:11 -0700 Subject: clean up logging mess: add 'logfile' define, mv openvpn and stunnel logs to their own files, fix mx logwatch path. --- puppet/modules/leap/manifests/logfile.pp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 puppet/modules/leap/manifests/logfile.pp (limited to 'puppet/modules/leap/manifests/logfile.pp') diff --git a/puppet/modules/leap/manifests/logfile.pp b/puppet/modules/leap/manifests/logfile.pp new file mode 100644 index 00000000..42a82943 --- /dev/null +++ b/puppet/modules/leap/manifests/logfile.pp @@ -0,0 +1,26 @@ +# +# make syslog log to a particular file for a particular process. +# + +define leap::logfile($process=$title) { + $logfile = "/var/log/leap/${title}.log" + + rsyslog::snippet { "50-${name}": + content => "if \$programname startswith '${process}' then ${logfile} +&~" + } + + augeas { + "logrotate_${name}": + context => "/files/etc/logrotate.d/${name}/rule", + changes => [ + "set file ${logfile}", + 'set rotate 7', + 'set schedule daily', + 'set compress compress', + 'set missingok missingok', + 'set ifempty notifempty', + 'set copytruncate copytruncate' + ] + } +} -- cgit v1.2.3 From e97a00725c80a4067d5bba24d931b1a3bcf2ad96 Mon Sep 17 00:00:00 2001 From: elijah Date: Thu, 16 Apr 2015 20:57:26 -0700 Subject: keep five log files instead of seven. --- puppet/modules/leap/manifests/logfile.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'puppet/modules/leap/manifests/logfile.pp') diff --git a/puppet/modules/leap/manifests/logfile.pp b/puppet/modules/leap/manifests/logfile.pp index 42a82943..4deafacb 100644 --- a/puppet/modules/leap/manifests/logfile.pp +++ b/puppet/modules/leap/manifests/logfile.pp @@ -15,7 +15,7 @@ define leap::logfile($process=$title) { context => "/files/etc/logrotate.d/${name}/rule", changes => [ "set file ${logfile}", - 'set rotate 7', + 'set rotate 5', 'set schedule daily', 'set compress compress', 'set missingok missingok', -- cgit v1.2.3 From 64cc83793aa35b84b60dd40305c7edf8369a187b Mon Sep 17 00:00:00 2001 From: elijah Date: Fri, 17 Apr 2015 10:19:37 -0700 Subject: rename leap-mx logrotate file; minor style change. --- puppet/modules/leap/manifests/logfile.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'puppet/modules/leap/manifests/logfile.pp') diff --git a/puppet/modules/leap/manifests/logfile.pp b/puppet/modules/leap/manifests/logfile.pp index 4deafacb..c5c185f6 100644 --- a/puppet/modules/leap/manifests/logfile.pp +++ b/puppet/modules/leap/manifests/logfile.pp @@ -2,8 +2,8 @@ # make syslog log to a particular file for a particular process. # -define leap::logfile($process=$title) { - $logfile = "/var/log/leap/${title}.log" +define leap::logfile($process=$name) { + $logfile = "/var/log/leap/${name}.log" rsyslog::snippet { "50-${name}": content => "if \$programname startswith '${process}' then ${logfile} -- cgit v1.2.3 From cdf0b448aa4cdac8eb04f05bdeb1d4bf7630938e Mon Sep 17 00:00:00 2001 From: varac Date: Sun, 26 Apr 2015 22:03:31 +0200 Subject: Use rsyslog traditional timestamp format in custom logfiles #6886 Change-Id: I9e033f63e3b387e95f5bf1c3820e456f740d8180 --- puppet/modules/leap/manifests/logfile.pp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'puppet/modules/leap/manifests/logfile.pp') diff --git a/puppet/modules/leap/manifests/logfile.pp b/puppet/modules/leap/manifests/logfile.pp index c5c185f6..63dbd16b 100644 --- a/puppet/modules/leap/manifests/logfile.pp +++ b/puppet/modules/leap/manifests/logfile.pp @@ -6,8 +6,7 @@ define leap::logfile($process=$name) { $logfile = "/var/log/leap/${name}.log" rsyslog::snippet { "50-${name}": - content => "if \$programname startswith '${process}' then ${logfile} -&~" + content => template('leap/rsyslog.erb') } augeas { -- cgit v1.2.3