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 ba46b519bd..4b8067e0db 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 @type file - path /var/log/kolla/swift/swift_latest.*.log + path /var/log/kolla/swift/swift_latest append true - compress gzip - - timekey_use_utc + # Disable timestamp in filename for logs + + path /var/log/kolla/swift/swift_latest.*.buffer {% if log_direct_to_elasticsearch %} @@ -66,14 +66,17 @@ @type copy @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 - - timekey_use_utc + # Disable timestamp in filename for logs + + path /var/log/kolla/haproxy/haproxy_latest.*.buffer + # Don't prepend syslog tag or timestamp to log output + + output_tag false + output_time false + {% if log_direct_to_elasticsearch %} @@ -131,14 +134,17 @@ @type copy @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 - - timekey_use_utc + # Disable timestamp in filename for logs + + path /var/log/kolla/glance-tls-proxy/glance-tls-proxy.*.buffer + # Don't prepend syslog tag or timestamp to log output + + output_tag false + output_time false + {% if log_direct_to_elasticsearch %} @@ -193,14 +199,17 @@ @type copy @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 - - timekey_use_utc + # Disable timestamp in filename for logs + + path /var/log/kolla/neutron-tls-proxy/neutron-tls-proxy.*.buffer + # Don't prepend syslog tag or timestamp to log output + + output_tag false + output_time false + {% if log_direct_to_elasticsearch %} diff --git a/ansible/roles/common/templates/cron-logrotate-haproxy.conf.j2 b/ansible/roles/common/templates/cron-logrotate-haproxy.conf.j2 index 7af26dd38b..3e89a2e751 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 0000000000..d2c1ad6056 --- /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.