Add systemd journal logging to the service config

The systemd journal would normally be populated with the standard out of
a service however with the use of uwsgi this is not actually happening
resulting in us only capturing the logs from the uwsgi process instead
of the service itself. This change implements journal logging in the
service config, which is part of OSLO logging.

OSLO logging docs found here: <https://docs.openstack.org/oslo.log/3.28.1/journal.html>

Change-Id: I7bd5419e7f02593a16614746a974b5f8ab3aa504
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
Kevin Carter 2018-07-30 09:27:46 -05:00
parent ad394265bc
commit a99723f335
No known key found for this signature in database
GPG Key ID: 9443251A787B9FB3
8 changed files with 32 additions and 24 deletions

View File

@ -141,6 +141,7 @@ aodh_pip_packages:
- python-memcached
- sqlalchemy>=0.9.7
- sqlalchemy-utils
- systemd-python
- warlock
aodh_alarm_notifier_init_overrides: {}

View File

@ -0,0 +1,9 @@
---
deprecations:
- The log path, ``/var/log/aodh`` is no longer used to capture service
logs. All logging for the aodh service will now be sent directly to the
systmed journal.
other:
- When running aodh with apache(httpd) all apache logs will be stored in
the standard apache log directory which is controlled by the distro specific
variable ``aodh_apache_default_log_folder``.

View File

@ -53,24 +53,3 @@
with_items:
- { path: "/var/www/cgi-bin", owner: root, group: root }
- { path: "/var/www/cgi-bin/aodh" }
- name: Test for log directory or link
shell: |
if [ -h "/var/log/aodh" ]; then
chown -h {{ aodh_system_user_name }}:{{ aodh_system_group_name }} "/var/log/aodh"
chown -R {{ aodh_system_user_name }}:{{ aodh_system_group_name }} "$(readlink /var/log/aodh)"
else
exit 1
fi
register: log_dir
failed_when: false
changed_when: log_dir.rc != 0
- name: Create aodh log dir
file:
path: "/var/log/aodh"
state: directory
owner: "{{ aodh_system_user_name }}"
group: "{{ aodh_system_group_name }}"
mode: "0755"
when: log_dir.rc != 0

View File

@ -11,8 +11,8 @@
</IfVersion>
LogLevel {{ aodh_apache_log_level }}
ErrorLog /var/log/aodh/aodh-apache-error.log
CustomLog /var/log/aodh/aodh-access.log combined
ErrorLog {{ aodh_apache_default_log_folder }}/aodh-apache-error.log
CustomLog {{ aodh_apache_default_log_folder }}/aodh-access.log combined
</VirtualHost>
<Directory "/var/www/cgi-bin">

View File

@ -1,6 +1,7 @@
#{{ ansible_managed}}
[DEFAULT]
use_journal = True
# Disable stderr logging
use_stderr = False
auth_strategy = keystone

View File

@ -26,8 +26,10 @@ aodh_distro_packages:
aodh_devel_distro_packages:
- libffi-dev
- libssl-dev
- libsystemd-dev
- libxml2-dev
- libxslt1-dev
- pkg-config
aodh_service_distro_packages:
- aodh-api
@ -35,6 +37,8 @@ aodh_service_distro_packages:
- aodh-expirer
- aodh-listener
- aodh-notifier
- python-systemd
- python3-systemd
aodh_test_distro_packages:
- git
@ -55,4 +59,9 @@ aodh_apache_site_enabled: "/etc/apache2/sites-enabled/aodh-httpd.conf"
aodh_apache_conf: "/etc/apache2/apache2.conf"
aodh_apache_security_conf: "/etc/apache2/conf-available/security.conf"
aodh_apache_default_log_folder: "/var/log/apache2"
# This can be enabled when Apache2.5+ is available
# aodh_apache_modules:
# - name: "mod_journald"
# state: "present

View File

@ -25,6 +25,7 @@ aodh_devel_distro_packages:
- openssl-devel
- libxml2-devel
- libxslt-devel
- systemd-devel
- which
aodh_service_distro_packages:
@ -33,6 +34,7 @@ aodh_service_distro_packages:
- openstack-aodh-expirer
- openstack-aodh-listener
- openstack-aodh-notifier
- systemd-python
aodh_test_distro_packages:
- git
@ -50,4 +52,4 @@ aodh_apache_default_sites:
aodh_apache_conf: "/etc/httpd/conf/httpd.conf"
aodh_apache_security_conf: "{{ aodh_apache_conf }}"
aodh_apache_default_log_folder: "/var/log/httpd"

View File

@ -26,6 +26,8 @@ aodh_devel_distro_packages:
- libopenssl-devel
- libxml2-devel
- libxslt-devel
- systemd-devel
- pkg-config
- which
aodh_service_distro_packages:
@ -35,6 +37,7 @@ aodh_service_distro_packages:
- openstack-aodh-expirer
- openstack-aodh-listener
- openstack-aodh-notifier
- python-systemd
aodh_test_distro_packages:
- git-core
@ -50,6 +53,7 @@ aodh_apache_default_sites:
aodh_apache_conf: "/etc/apache2/httpd.conf"
aodh_apache_security_conf: "{{ aodh_apache_conf }}"
aodh_apache_default_log_folder: "/var/log/apache2"
aodh_apache_modules:
- name: "authz_host"
@ -58,3 +62,6 @@ aodh_apache_modules:
state: "present"
- name: "version"
state: "present"
# This can be enabled when Apache2.5+ is available
# - name: "mod_journald"
# state: "present