diff --git a/ansible/roles/common/templates/conf/output/00-local.conf.j2 b/ansible/roles/common/templates/conf/output/00-local.conf.j2 index ba46b519bd44fe55e59470df31b4c67252884d42..4b8067e0dbfc493fae3561ab81a97629653d7409 100644 --- a/ansible/roles/common/templates/conf/output/00-local.conf.j2 +++ b/ansible/roles/common/templates/conf/output/00-local.conf.j2 @@ -3,11 +3,11 @@ @type copy <store> @type file - path /var/log/kolla/swift/swift_latest.*.log + path /var/log/kolla/swift/swift_latest append true - compress gzip - <buffer> - timekey_use_utc + # Disable timestamp in filename for logs + <buffer []> + path /var/log/kolla/swift/swift_latest.*.buffer </buffer> </store> {% if log_direct_to_elasticsearch %} @@ -66,14 +66,17 @@ @type copy <store> @type file - path /var/log/kolla/haproxy/haproxy_latest.*.log - output_tag false - output_time false + path /var/log/kolla/haproxy/haproxy_latest append true - compress gzip - <buffer> - timekey_use_utc + # Disable timestamp in filename for logs + <buffer []> + path /var/log/kolla/haproxy/haproxy_latest.*.buffer </buffer> + # Don't prepend syslog tag or timestamp to log output + <format> + output_tag false + output_time false + </format> </store> {% if log_direct_to_elasticsearch %} <store> @@ -131,14 +134,17 @@ @type copy <store> @type file - path /var/log/kolla/glance-tls-proxy/glance-tls-proxy.*.log - output_tag false - output_time false + path /var/log/kolla/glance-tls-proxy/glance-tls-proxy append true - compress gzip - <buffer> - timekey_use_utc + # Disable timestamp in filename for logs + <buffer []> + path /var/log/kolla/glance-tls-proxy/glance-tls-proxy.*.buffer </buffer> + # Don't prepend syslog tag or timestamp to log output + <format> + output_tag false + output_time false + </format> </store> {% if log_direct_to_elasticsearch %} <store> @@ -193,14 +199,17 @@ @type copy <store> @type file - path /var/log/kolla/neutron-tls-proxy/neutron-tls-proxy.*.log - output_tag false - output_time false + path /var/log/kolla/neutron-tls-proxy/neutron-tls-proxy append true - compress gzip - <buffer> - timekey_use_utc + # Disable timestamp in filename for logs + <buffer []> + path /var/log/kolla/neutron-tls-proxy/neutron-tls-proxy.*.buffer </buffer> + # Don't prepend syslog tag or timestamp to log output + <format> + output_tag false + output_time false + </format> </store> {% if log_direct_to_elasticsearch %} <store> diff --git a/ansible/roles/common/templates/cron-logrotate-haproxy.conf.j2 b/ansible/roles/common/templates/cron-logrotate-haproxy.conf.j2 index 7af26dd38b4b72e2e68337698a174cb352aa3fe8..3e89a2e7511725e62974730cc1e39a4034d887ae 100644 --- a/ansible/roles/common/templates/cron-logrotate-haproxy.conf.j2 +++ b/ansible/roles/common/templates/cron-logrotate-haproxy.conf.j2 @@ -1,3 +1,3 @@ -"/var/log/kolla/haproxy/haproxy.log" +"/var/log/kolla/haproxy/*.log" { } diff --git a/releasenotes/notes/fix-haproxy-logrotate-e299a0000728fd8f.yaml b/releasenotes/notes/fix-haproxy-logrotate-e299a0000728fd8f.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d2c1ad60560bd0bc0afc684ad85902be675b898d --- /dev/null +++ b/releasenotes/notes/fix-haproxy-logrotate-e299a0000728fd8f.yaml @@ -0,0 +1,12 @@ +--- +issues: + - | + Existing fluentd log rotation failed to delete old haproxy, swift, + glance-tls-proxy and neutron-tls-proxy logs. These will not be + deleted by the new logrotate config and will have to be removed + manually. +fixes: + - | + Existing fluentd log rotation failed to delete old haproxy, swift, + glance-tls-proxy and neutron-tls-proxy logs. Standardise rotation + and deletion of logs using logrotate.