Skip to content

Commit b1bf8a9

Browse files
author
Christopher M. Neill
committed
Test in gamma, deploy to prod.
1 parent 17a8c4b commit b1bf8a9

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

ansible/roles/loggly-rotate/templates/21-output-syslog.conf.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ $PrivDropToGroup adm
33

44
# start log rotation via outchannel
55
# outchannel definition
6-
$outchannel log_rotation_{{ name }},/var/log/{{ name }}.log,52428800,/opt/runnable/bin/rotate-{{ name }}-logs.sh
6+
$outchannel log_rotation_{{ name }},/var/log/{{ name }}-daemon.log,52428800,/opt/runnable/bin/rotate-{{ name }}-logs.sh
77
# activate the channel and log everything to it
88
if $msg contains '{{ name }}' and $syslogfacility-text == 'local7' then :omfile:$log_rotation_{{ name }}
99
# end log rotation via outchannel
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#!/usr/bin/env bash
22

3-
find /var/log -type f -name '{{ name }}.log.*' -mtime +3 -exec rm -f {} \; > /dev/null 2>&1
4-
find /var/log -type f -name '{{ name }}.log.*' -mtime +1 -exec bzip2 -9 {} \; > /dev/null 2>&1
5-
3+
# literally truncate the file
4+
cat /dev/null > /var/log/{{ name }}-daemon.log 2>&1
65
# exit code? don't care
76

87
exit 0

0 commit comments

Comments
 (0)