From cebb77d7e218d0978519288d0d4071c451e26c92 Mon Sep 17 00:00:00 2001 From: "tone.zhang" Date: Thu, 21 Jun 2018 12:52:39 +0800 Subject: [PATCH] Make Swift log_level changeable The log_level in Swift is fixed to INFO. The patch make it changeable according to the value of "openstack_logging_debug". When "openstack_logging_debug" is "False", the log_level is set to "INFO". It is default value. Otherwise, the log_level is set to "DEBUG". Closes-Bug: #1777982 Change-Id: I62f430abd8f332cc2ece56a6733776fa03b10f77 Signed-off-by: tone.zhang --- ansible/roles/swift/defaults/main.yml | 2 ++ ansible/roles/swift/templates/account.conf.j2 | 2 +- ansible/roles/swift/templates/container.conf.j2 | 2 +- ansible/roles/swift/templates/object.conf.j2 | 2 +- ansible/roles/swift/templates/proxy-server.conf.j2 | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ansible/roles/swift/defaults/main.yml b/ansible/roles/swift/defaults/main.yml index d433fbe51a..ec84027848 100644 --- a/ansible/roles/swift/defaults/main.yml +++ b/ansible/roles/swift/defaults/main.yml @@ -31,6 +31,8 @@ swift_rsyncd_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ do swift_rsyncd_tag: "{{ swift_tag }}" swift_rsyncd_image_full: "{{ swift_rsyncd_image }}:{{ swift_rsyncd_tag }}" +swift_log_level: "{{ 'INFO' if openstack_logging_debug == 'False' else 'DEBUG'}}" + #################### # OpenStack #################### diff --git a/ansible/roles/swift/templates/account.conf.j2 b/ansible/roles/swift/templates/account.conf.j2 index 9863eda519..36b2d7367d 100644 --- a/ansible/roles/swift/templates/account.conf.j2 +++ b/ansible/roles/swift/templates/account.conf.j2 @@ -7,7 +7,7 @@ log_udp_host = {{ syslog_server }} log_udp_port = {{ syslog_udp_port }} log_name = {{ service_name }} log_facility = {{ syslog_swift_facility }} -log_level = INFO +log_level = {{ swift_log_level }} workers = {{ openstack_service_workers }} [pipeline:main] diff --git a/ansible/roles/swift/templates/container.conf.j2 b/ansible/roles/swift/templates/container.conf.j2 index 1cbc627524..a12537580e 100644 --- a/ansible/roles/swift/templates/container.conf.j2 +++ b/ansible/roles/swift/templates/container.conf.j2 @@ -7,7 +7,7 @@ log_udp_host = {{ syslog_server }} log_udp_port = {{ syslog_udp_port }} log_name = {{ service_name }} log_facility = {{ syslog_swift_facility }} -log_level = INFO +log_level = {{ swift_log_level }} workers = {{ openstack_service_workers }} [pipeline:main] diff --git a/ansible/roles/swift/templates/object.conf.j2 b/ansible/roles/swift/templates/object.conf.j2 index d2513255df..204a9a0bb9 100644 --- a/ansible/roles/swift/templates/object.conf.j2 +++ b/ansible/roles/swift/templates/object.conf.j2 @@ -8,7 +8,7 @@ log_udp_host = {{ syslog_server }} log_udp_port = {{ syslog_udp_port }} log_name = {{ service_name }} log_facility = {{ syslog_swift_facility }} -log_level = INFO +log_level = {{ swift_log_level }} workers = {{ openstack_service_workers }} [pipeline:main] diff --git a/ansible/roles/swift/templates/proxy-server.conf.j2 b/ansible/roles/swift/templates/proxy-server.conf.j2 index efe81d32a8..ecfe735be3 100644 --- a/ansible/roles/swift/templates/proxy-server.conf.j2 +++ b/ansible/roles/swift/templates/proxy-server.conf.j2 @@ -6,7 +6,7 @@ log_udp_host = {{ syslog_server }} log_udp_port = {{ syslog_udp_port }} log_name = {{ service_name }} log_facility = {{ syslog_swift_facility }} -log_level = INFO +log_level = {{ swift_log_level }} workers = {{ openstack_service_workers }} [pipeline:main]