Unhardcode logger log level
This patch unhardcode log level in loggig.conf template.
The log level might be configured per logger by using the
following pillar structure:
nova:
controller:
logging:
loggers:
<logger_name>:
level: WARNING
Change-Id: Id7c5c73ee645f323028ba0acea27a2bc4026eb9c
Related-Prod: PROD-19782
diff --git a/README.rst b/README.rst
index 3cf25d0..bf4cbe2 100644
--- a/README.rst
+++ b/README.rst
@@ -753,6 +753,25 @@
ossyslog:
enabled: true
+The log level might be configured per logger by using the
+following pillar structure:
+
+.. code-block:: yaml
+
+ nova:
+ compute:
+ logging:
+ loggers:
+ <logger_name>:
+ level: WARNING
+
+ nova:
+ compute:
+ logging:
+ loggers:
+ <logger_name>:
+ level: WARNING
+
Inject password to VM
---------------------
diff --git a/nova/files/logging.conf b/nova/files/logging.conf
index 35c3c4b..c34eae6 100644
--- a/nova/files/logging.conf
+++ b/nova/files/logging.conf
@@ -15,27 +15,27 @@
keys = context, default{% if values.logging.log_handlers.get('fluentd', {}).get('enabled', False) %}, fluentd{% endif %}
[logger_root]
-level = WARNING
+level = {{ values.logging.get('loggers', {}).get('root', {}).get('level', 'WARNING') }}
handlers = {{ log_handlers | join(", ") }}
[logger_nova]
-level = INFO
+level = {{ values.logging.get('loggers', {}).get('nova', {}).get('level', 'INFO') }}
handlers = {{ log_handlers | join(", ") }}
qualname = nova
propagate = 0
[logger_amqp]
-level = WARNING
+level = {{ values.logging.get('loggers', {}).get('amqp', {}).get('level', 'WARNING') }}
handlers = {{ log_handlers | join(", ") }}
qualname = amqp
[logger_amqplib]
-level = WARNING
+level = {{ values.logging.get('loggers', {}).get('amqplib', {}).get('level', 'WARNING') }}
handlers = {{ log_handlers | join(", ") }}
qualname = amqplib
[logger_sqlalchemy]
-level = WARNING
+level = {{ values.logging.get('loggers', {}).get('sqlalchemy', {}).get('level', 'WARNING') }}
handlers = {{ log_handlers | join(", ") }}
qualname = sqlalchemy
# "level = INFO" logs SQL queries.
@@ -43,7 +43,7 @@
# "level = WARNING" logs neither. (Recommended for production systems.)
[logger_boto]
-level = WARNING
+level = {{ values.logging.get('loggers', {}).get('boto', {}).get('level', 'WARNING') }}
handlers = {{ log_handlers | join(", ") }}
qualname = boto
@@ -51,12 +51,12 @@
# cause many extraneous log lines for their tempest runs. Refer to
# https://review.openstack.org/#/c/219225/ for details.
[logger_suds]
-level = INFO
+level = {{ values.logging.get('loggers', {}).get('suds', {}).get('level', 'INFO') }}
handlers = {{ log_handlers | join(", ") }}
qualname = suds
[logger_eventletwsgi]
-level = WARNING
+level = {{ values.logging.get('loggers', {}).get('eventletwsgi', {}).get('level', 'WARNING') }}
handlers = {{ log_handlers | join(", ") }}
qualname = eventlet.wsgi.server