Skip to content

Commit 4f69885

Browse files
dougszumskidincercelik
authored andcommitted
Fix Barbican API log config
There are a few issues fixed here: - The Barbican API service doesn't set a log file, so all the Barbican API service logs go to loadwsgi.py.log by default. - The logs in loadwsgi.py.log are not ingested properly by Fluentd. - uWSGI logs go to barbican-api.log. This would normally be used as the log file for the Barbican API service logs. This patch makes the following changes to address the above issues: - All uWSGI logs (from the Emperor and Vassals) go to barbican_api_uwsgi_access.log Although these logs aren't strictly all access logs, this follows the existing pattern for WSGI logs. - The Barbican API service logs are written to barbican-api.log instead of loadwsgi.py.log. This follows the pattern used by other OpenStack services. - Fluentd is configured to parse the Barbican API service logs as it would with other OpenStack Python services. Change-Id: I6d03fa8c81c52b6f061514a836bbd15bb6639aaf Closes-Bug: #1891343
1 parent 05e6d4a commit 4f69885

File tree

6 files changed

+14
-5
lines changed

6 files changed

+14
-5
lines changed

ansible/roles/barbican/templates/barbican-api.ini.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ memory-report = true
1212
plugins = python3
1313
paste = config:/etc/barbican/barbican-api-paste.ini
1414
add-header = Connection: close
15+
logto = /var/log/kolla/barbican/barbican_api_uwsgi_access.log

ansible/roles/barbican/templates/barbican-api.json.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"command": "uwsgi --master --emperor /etc/barbican/vassals --logto /var/log/kolla/barbican/barbican-api.log --logfile-chmod 644",
2+
"command": "uwsgi --master --emperor /etc/barbican/vassals --logto /var/log/kolla/barbican/barbican_api_uwsgi_access.log --logfile-chmod 644",
33
"config_files": [
44
{
55
"source": "{{ container_config_directory }}/barbican.conf",

ansible/roles/barbican/templates/barbican.conf.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
[DEFAULT]
22
debug = {{ barbican_logging_debug }}
33
log_dir = /var/log/kolla/barbican
4+
{% if service_name == "barbican-api" %}
5+
log_file = barbican-api.log
6+
{% endif %}
47

58
bind_port = {{ barbican_api_listen_port }}
69
bind_host = {{ api_interface_address }}

ansible/roles/common/templates/conf/filter/01-rewrite-0.12.conf.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
@type rewrite_tag_filter
33
capitalize_regex_backreference yes
44
rewriterule1 programname ^(cinder-api-access|cloudkitty-api-access|gnocchi-api-access|horizon-access|keystone-apache-admin-access|keystone-apache-public-access|monasca-api-access|placement-api-access|panko-api-access)$ apache_access
5-
rewriterule2 programname ^(aodh_wsgi_access|barbican-api|zun_api_wsgi_access|vitrage_wsgi_access)$ wsgi_access
5+
rewriterule2 programname ^(aodh_wsgi_access|barbican_api_uwsgi_access|zun_api_wsgi_access|vitrage_wsgi_access)$ wsgi_access
66
rewriterule3 programname ^(nova-api|nova-compute|nova-compute-ironic|nova-conductor|nova-manage|nova-novncproxy|nova-scheduler|nova-placement-api|placement-api|privsep-helper)$ openstack_python
77
rewriterule4 programname ^(sahara-api|sahara-engine)$ openstack_python
88
rewriterule5 programname ^(neutron-server|neutron-openvswitch-agent|neutron-ns-metadata-proxy|neutron-metadata-agent|neutron-l3-agent|neutron-dhcp-agent)$ openstack_python
@@ -12,7 +12,7 @@
1212
rewriterule9 programname ^(glance-api)$ openstack_python
1313
rewriterule10 programname ^(cloudkitty-storage-init|cloudkitty-processor|cloudkitty-dbsync|cloudkitty-api)$ openstack_python
1414
rewriterule11 programname ^(ceilometer-polling|ceilometer-agent-notification)$ openstack_python
15-
rewriterule12 programname ^(barbican-worker|barbican-keystone-listener|barbican-db-manage|app)$ openstack_python
15+
rewriterule12 programname ^(barbican-api|barbican-worker|barbican-keystone-listener|barbican-db-manage|app)$ openstack_python
1616
rewriterule13 programname ^(aodh-notifier|aodh-listener|aodh-evaluator|aodh-dbsync)$ openstack_python
1717
rewriterule14 programname ^(cinder-api|cinder-scheduler|cinder-manage|cinder-volume|cinder-backup|privsep-helper)$ openstack_python
1818
rewriterule15 programname ^(mistral-server|mistral-engine|mistral-executor)$ openstack_python

ansible/roles/common/templates/conf/filter/01-rewrite-0.14.conf.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</rule>
99
<rule>
1010
key programname
11-
pattern ^(aodh_wsgi_access|barbican-api|zun_api_wsgi_access|vitrage_wsgi_access)$
11+
pattern ^(aodh_wsgi_access|barbican_api_uwsgi_access|zun_api_wsgi_access|vitrage_wsgi_access)$
1212
tag wsgi_access
1313
</rule>
1414
<rule>
@@ -58,7 +58,7 @@
5858
</rule>
5959
<rule>
6060
key programname
61-
pattern ^(barbican-worker|barbican-keystone-listener|barbican-db-manage|app)$
61+
pattern ^(barbican-api|barbican-worker|barbican-keystone-listener|barbican-db-manage|app)$
6262
tag openstack_python
6363
</rule>
6464
<rule>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
fixes:
3+
- |
4+
Fixes some configuration issues around Barbican logging. `LP#1891343
5+
<https://bugs.launchpad.net/kolla-ansible/+bug/1891343>`__

0 commit comments

Comments
 (0)