From 159016a4c3fcc8204b769fb41cdab84f2becfc1b Mon Sep 17 00:00:00 2001 From: Lee Yarwood Date: Fri, 3 Dec 2021 16:37:15 +0000 Subject: [PATCH] conf: Allow cinderclient and os_brick to independently log at DEBUG This change adds a simple [cinder]debug configurable to allow cinderclient and os_brick to be made to log at DEBUG independently of the rest of Nova. Change-Id: I84f5b73adddf42831f1d9e129c25bf955e6eda78 --- nova/conf/cinder.py | 6 ++++++ nova/config.py | 5 +++++ releasenotes/notes/cinder-debug-c522618d82987971.yaml | 6 ++++++ 3 files changed, 17 insertions(+) create mode 100644 releasenotes/notes/cinder-debug-c522618d82987971.yaml diff --git a/nova/conf/cinder.py b/nova/conf/cinder.py index 68a6c46b6c27..71ce48ff90e8 100644 --- a/nova/conf/cinder.py +++ b/nova/conf/cinder.py @@ -103,6 +103,12 @@ By default there is no availability zone restriction on volume attach. Related options: * ``[DEFAULT]/default_schedule_zone`` +"""), + cfg.BoolOpt('debug', + default=False, + help=""" +Enable DEBUG logging with cinderclient and os_brick independently of the rest +of Nova. """), ] diff --git a/nova/config.py b/nova/config.py index 98aad0c73f18..545fc5714591 100644 --- a/nova/config.py +++ b/nova/config.py @@ -70,6 +70,11 @@ def set_log_defaults(): extra_default_log_levels = ['glanceclient=DEBUG'] else: extra_default_log_levels = ['glanceclient=WARN'] + + # Allow cinderclient and os_brick to log at DEBUG without Nova + if CONF.cinder.debug: + extra_default_log_levels += ['cinderclient=DEBUG', 'os_brick=DEBUG'] + # NOTE(danms): DEBUG logging in privsep will result in some large # and potentially sensitive things being logged. extra_default_log_levels.append('oslo.privsep.daemon=INFO') diff --git a/releasenotes/notes/cinder-debug-c522618d82987971.yaml b/releasenotes/notes/cinder-debug-c522618d82987971.yaml new file mode 100644 index 000000000000..5eb8a7642510 --- /dev/null +++ b/releasenotes/notes/cinder-debug-c522618d82987971.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + A new ``[cinder]/debug`` configurable has been introduced to enable DEBUG + logging for both the ``python-cinderclient`` and ``os-brick`` libraries + independently to the rest of Nova.