From 4168b46cffc6297bd069400eb76abb38d28cfb5a Mon Sep 17 00:00:00 2001 From: Doug Szumski Date: Mon, 27 Nov 2023 15:41:29 +0000 Subject: [PATCH] Fix Horizon WSGI application log parsing Like other WSGI services in Kolla Ansible, the Horizon WSGI application handles log output via the `wsgi.errors` object. See [1] for further information. The problem is that this log output is written to a file called `horizon.log`, causing it to processed as an 'Oslo log' in the Fluentd processing pipeline. Since the log format doesn't match the expected format, this results in parsing errors. This fix renames the log file and adjusts the format to match other WSGI applications. The logs are then processed in the same way as other WSGI application logs, resolving the issue. [1] https://modwsgi.readthedocs.io/en/master/user-guides/debugging-techniques.html Change-Id: I93777d1c53920f5470c78356e6b3a4064fbe04b4 Closes-Bug: #1898174 --- ansible/roles/horizon/templates/horizon.conf.j2 | 3 ++- .../notes/horizon-log-bugfix-b89f502c2f3ccaf9.yaml | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/horizon-log-bugfix-b89f502c2f3ccaf9.yaml diff --git a/ansible/roles/horizon/templates/horizon.conf.j2 b/ansible/roles/horizon/templates/horizon.conf.j2 index 0c6cc0eb25..e5f851aeba 100644 --- a/ansible/roles/horizon/templates/horizon.conf.j2 +++ b/ansible/roles/horizon/templates/horizon.conf.j2 @@ -15,7 +15,8 @@ TraceEnable off LogLevel warn - ErrorLog /var/log/kolla/horizon/horizon.log + ErrorLogFormat "%{cu}t %M" + ErrorLog /var/log/kolla/horizon/horizon-error.log LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b %D \"%{Referer}i\" \"%{User-Agent}i\"" logformat CustomLog /var/log/kolla/horizon/horizon-access.log logformat diff --git a/releasenotes/notes/horizon-log-bugfix-b89f502c2f3ccaf9.yaml b/releasenotes/notes/horizon-log-bugfix-b89f502c2f3ccaf9.yaml new file mode 100644 index 0000000000..cda884b721 --- /dev/null +++ b/releasenotes/notes/horizon-log-bugfix-b89f502c2f3ccaf9.yaml @@ -0,0 +1,8 @@ +--- +fixes: + - | + Fixes an issue where Fluentd was parsing Horizon WSGI application logs + incorrectly. + Horizon error logs are now written to ``horizon-error.log`` instead of + ``horizon.log``. + See `LP#1898174 `__