From 493650aa5eeded262cfa48ea5d6ae5927569c871 Mon Sep 17 00:00:00 2001 From: Carlos Cesario Date: Sat, 26 Mar 2016 14:12:58 -0300 Subject: [PATCH] Change keystone log dir Proposed patch to change keystone and heka log dir from /var/log/kolla/apache2/ to /var/log/kolla/keystone/ Closes-Bug: #1560620 Change-Id: I70c65ceba5a301cc56880313ca86f01bd35676cb --- .../common/templates/cron-logrotate-keystone.conf.j2 | 2 -- ansible/roles/common/templates/heka-keystone.toml.j2 | 3 +-- ansible/roles/keystone/templates/wsgi-keystone.conf.j2 | 10 +++++----- docker/keystone/extend_start.sh | 9 --------- 4 files changed, 6 insertions(+), 18 deletions(-) diff --git a/ansible/roles/common/templates/cron-logrotate-keystone.conf.j2 b/ansible/roles/common/templates/cron-logrotate-keystone.conf.j2 index 22dded903d..79cf10b347 100644 --- a/ansible/roles/common/templates/cron-logrotate-keystone.conf.j2 +++ b/ansible/roles/common/templates/cron-logrotate-keystone.conf.j2 @@ -1,5 +1,3 @@ -{% set apache_dir = 'apache2' if kolla_base_distro in ['ubuntu', 'debian'] else 'httpd' %} "/var/log/kolla/keystone/*.log" -"/var/log/kolla/{{ apache_dir }}/keystone-apache-*.log" { } diff --git a/ansible/roles/common/templates/heka-keystone.toml.j2 b/ansible/roles/common/templates/heka-keystone.toml.j2 index 6d7874d566..19cc69c6d9 100644 --- a/ansible/roles/common/templates/heka-keystone.toml.j2 +++ b/ansible/roles/common/templates/heka-keystone.toml.j2 @@ -1,4 +1,3 @@ -{% set apache_dir = 'apache2' if kolla_base_distro in ['ubuntu', 'debian'] else 'httpd' %} [keystone_apache_log_decoder] type = "SandboxDecoder" filename = "lua_decoders/os_keystone_apache_log.lua" @@ -9,6 +8,6 @@ filename = "lua_decoders/os_keystone_apache_log.lua" type = "LogstreamerInput" decoder = "keystone_apache_log_decoder" log_directory = "/var/log/kolla" -file_match = '{{ apache_dir }}/keystone-apache-(?P.+)-access\.log\.?(?P\d*)$' +file_match = 'keystone/keystone-apache-(?P.+)-access\.log\.?(?P\d*)$' priority = ["^Seq"] differentiator = ["keystone-apache-", "Service"] diff --git a/ansible/roles/keystone/templates/wsgi-keystone.conf.j2 b/ansible/roles/keystone/templates/wsgi-keystone.conf.j2 index 46c5725f7b..6389c7330b 100644 --- a/ansible/roles/keystone/templates/wsgi-keystone.conf.j2 +++ b/ansible/roles/keystone/templates/wsgi-keystone.conf.j2 @@ -1,4 +1,4 @@ -{% set apache_dir = 'apache2' if kolla_base_distro in ['ubuntu', 'debian'] else 'httpd' %} +{% set keystone_log_dir = '/var/log/kolla/keystone' %} {% set python_path = '/usr/lib/python2.7/site-packages' if kolla_install_type == 'binary' else '/var/lib/kolla/venv/lib/python2.7/site-packages' %} Listen {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ keystone_public_port }} Listen {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ keystone_admin_port }} @@ -12,9 +12,9 @@ Listen {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['addr = 2.4> ErrorLogFormat "%{cu}t %M" - ErrorLog "/var/log/kolla/{{ apache_dir }}/keystone-apache-public-error.log" + ErrorLog "{{ keystone_log_dir }}/keystone-apache-public-error.log" LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b %D \"%{Referer}i\" \"%{User-Agent}i\"" logformat - CustomLog "/var/log/kolla/{{ apache_dir }}/keystone-apache-public-access.log" logformat + CustomLog "{{ keystone_log_dir }}/keystone-apache-public-access.log" logformat @@ -26,7 +26,7 @@ Listen {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['addr = 2.4> ErrorLogFormat "%{cu}t %M" - ErrorLog "/var/log/kolla/{{ apache_dir }}/keystone-apache-admin-error.log" + ErrorLog "{{ keystone_log_dir }}/keystone-apache-admin-error.log" LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b %D \"%{Referer}i\" \"%{User-Agent}i\"" logformat - CustomLog "/var/log/kolla/{{ apache_dir }}/keystone-apache-admin-access.log" logformat + CustomLog "{{ keystone_log_dir }}/keystone-apache-admin-access.log" logformat diff --git a/docker/keystone/extend_start.sh b/docker/keystone/extend_start.sh index 672e92b539..594786c1dd 100644 --- a/docker/keystone/extend_start.sh +++ b/docker/keystone/extend_start.sh @@ -24,15 +24,6 @@ if [[ $(stat -c %a ${KEYSTONE_LOG_DIR}) != "755" ]]; then chmod 755 ${KEYSTONE_LOG_DIR} fi -# Create log dir for Apache logs -APACHE_LOG_DIR="/var/log/kolla/${APACHE_DIR}" -if [[ ! -d "${APACHE_LOG_DIR}" ]]; then - mkdir -p ${APACHE_LOG_DIR} -fi -if [[ $(stat -c %a ${APACHE_LOG_DIR}) != "755" ]]; then - chmod 755 ${APACHE_LOG_DIR} -fi - # Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases # of the KOLLA_BOOTSTRAP variable being set, including empty. if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then