From fa5511c75d79d8e258c4fa880d2c7a880b838bde Mon Sep 17 00:00:00 2001 From: Doug Szumski Date: Wed, 24 Feb 2021 13:21:51 +0000 Subject: [PATCH] Fix Cinder log parsing The Cinder API log is currently written to a file called cinder-wsgi.log, and the WSGI logs to cinder-api.log. Fluentd then tries to parse the WSGI log as an OpenStack log which results in 'got incomplete line' errors and prevents proper ingestion of these logs. Co-Authored-By: yaoning Closes-Bug: 1916752 Change-Id: I3296dcc4780160cbf88bd18285571276f58bb249 --- ansible/roles/cinder/templates/cinder-wsgi.conf.j2 | 2 +- ansible/roles/cinder/templates/cinder.conf.j2 | 3 +++ releasenotes/notes/fix-cinder-logging-22fea4739begd6s.yaml | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/fix-cinder-logging-22fea4739begd6s.yaml diff --git a/ansible/roles/cinder/templates/cinder-wsgi.conf.j2 b/ansible/roles/cinder/templates/cinder-wsgi.conf.j2 index 16deff8f06..10ea722b71 100644 --- a/ansible/roles/cinder/templates/cinder-wsgi.conf.j2 +++ b/ansible/roles/cinder/templates/cinder-wsgi.conf.j2 @@ -25,7 +25,7 @@ LogLevel info = 2.4> ErrorLogFormat "%{cu}t %M" - ErrorLog /var/log/kolla/cinder/cinder-api.log + ErrorLog /var/log/kolla/cinder/cinder-api-error.log LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b %D \"%{Referer}i\" \"%{User-Agent}i\"" logformat CustomLog /var/log/kolla/cinder/cinder-api-access.log logformat {% if cinder_enable_tls_backend | bool %} diff --git a/ansible/roles/cinder/templates/cinder.conf.j2 b/ansible/roles/cinder/templates/cinder.conf.j2 index c80ae265de..65bed63b48 100644 --- a/ansible/roles/cinder/templates/cinder.conf.j2 +++ b/ansible/roles/cinder/templates/cinder.conf.j2 @@ -2,6 +2,9 @@ debug = {{ cinder_logging_debug }} log_dir = /var/log/kolla/cinder +{% if service_name == "cinder-api" %} +log_file = cinder-api.log +{% endif %} use_forwarded_for = true # Set use_stderr to False or the logs will also be sent to stderr diff --git a/releasenotes/notes/fix-cinder-logging-22fea4739begd6s.yaml b/releasenotes/notes/fix-cinder-logging-22fea4739begd6s.yaml new file mode 100644 index 0000000000..0364eaeab9 --- /dev/null +++ b/releasenotes/notes/fix-cinder-logging-22fea4739begd6s.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fixes some configuration issues around Cinder logging. `LP#1916752 + `__