Use systemd-journald instead of log files

This patch aims to migrate service from usage of regular syslog files
to journald. We also disable uwsgi logging, since it dublicates
requests that are logged by service itself.

Change-Id: Ib16362a8becb6666f36e5abdb93c548de2a269da
This commit is contained in:
Dmitriy Rabotyagov 2019-07-17 19:52:24 +03:00
parent 546efd4b4d
commit ed8d692fa9
6 changed files with 5 additions and 23 deletions

View File

@ -220,6 +220,7 @@ trove_pip_packages:
- PyMySQL
- python-troveclient
- python-memcached
- systemd-python
- trove
trove_optional_oslomsg_amqp1_pip_packages:

View File

@ -59,26 +59,3 @@
when:
- trove_use_mod_wsgi | bool
- inventory_hostname in groups['trove_api']
- name: Test for log directory or link
shell: |
if [ -h "/var/log/trove" ]; then
chown -h {{ trove_system_user_name }}:{{ trove_system_group_name }} "/var/log/trove"
chown -R {{ trove_system_user_name }}:{{ trove_system_group_name }} "$(readlink /var/log/trove)"
else
exit 1
fi
register: log_dir
failed_when: false
changed_when: log_dir.rc != 0
- name: Create trove log dir
file:
path: "{{ item.path }}"
state: directory
owner: "{{ item.owner|default(trove_system_user_name) }}"
group: "{{ item.group|default(trove_system_group_name) }}"
mode: "{{ item.mode|default('0755') }}"
with_items:
- { path: "/var/log/trove" }
when: log_dir.rc != 0

View File

@ -1,6 +1,7 @@
# {{ ansible_managed }}
[DEFAULT]
debug = {{ debug }}
use_journal = true
bind_host = {{ trove_service_host }}
bind_port = {{ trove_service_port }}
trove_api_workers={{ trove_api_workers }}

View File

@ -21,4 +21,5 @@ trove_distro_packages:
- apache2
- apache2-utils
- libapache2-mod-wsgi
- libsystemd-dev
- qemu-utils

View File

@ -21,4 +21,5 @@ trove_distro_packages:
- httpd
- httpd-tools
- mod_wsgi
- systemd-devel
- qemu-img

View File

@ -20,4 +20,5 @@ trove_distro_packages:
- apache2
- apache2-utils
- apache2-mod_wsgi
- systemd-devel
- qemu-tools