Merge "Enable split logging for cinder-glanceclient interaction"
This commit is contained in:
commit
1e0632aeef
cinder
releasenotes/notes
@ -175,6 +175,9 @@ global_opts = [
|
||||
cfg.StrOpt('group_api_class',
|
||||
default='cinder.group.api.API',
|
||||
help='The full class name of the group API class'),
|
||||
cfg.BoolOpt('split_loggers',
|
||||
default=False,
|
||||
help='Log requests to multiple loggers.')
|
||||
]
|
||||
|
||||
CONF.register_opts(core_opts)
|
||||
|
@ -114,14 +114,16 @@ def _create_glance_client(context, netloc, use_ssl):
|
||||
if use_ssl and CONF.auth_strategy == 'noauth':
|
||||
params = {'insecure': CONF.glance_api_insecure,
|
||||
'cacert': CONF.glance_ca_certificates_file,
|
||||
'timeout': CONF.glance_request_timeout
|
||||
'timeout': CONF.glance_request_timeout,
|
||||
'split_loggers': CONF.split_loggers
|
||||
}
|
||||
if CONF.auth_strategy == 'keystone':
|
||||
global _SESSION
|
||||
if not _SESSION:
|
||||
config_options = {'insecure': CONF.glance_api_insecure,
|
||||
'cacert': CONF.glance_ca_certificates_file,
|
||||
'timeout': CONF.glance_request_timeout
|
||||
'timeout': CONF.glance_request_timeout,
|
||||
'split_loggers': CONF.split_loggers
|
||||
}
|
||||
_SESSION = ks_session.Session().load_from_options(**config_options)
|
||||
|
||||
|
@ -972,7 +972,8 @@ class TestGlanceImageServiceClient(test.TestCase):
|
||||
|
||||
config_options = {'insecure': False,
|
||||
'cacert': None,
|
||||
'timeout': None}
|
||||
'timeout': None,
|
||||
'split_loggers': False}
|
||||
|
||||
mock_get_auth_plugin.return_value = context._ContextAuthPlugin
|
||||
mock_load.return_value = session.Session
|
||||
@ -1003,7 +1004,8 @@ class TestGlanceImageServiceClient(test.TestCase):
|
||||
|
||||
config_options = {'insecure': False,
|
||||
'cacert': '/opt/stack/data/ca-bundle.pem',
|
||||
'timeout': 60}
|
||||
'timeout': 60,
|
||||
'split_loggers': False}
|
||||
|
||||
mock_get_auth_plugin.return_value = context._ContextAuthPlugin
|
||||
mock_load.return_value = session.Session
|
||||
|
@ -0,0 +1,12 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
Added boolean conf option 'split_loggers' in [default] section of
|
||||
cinder.conf to `enable split logging`_ functionality. The default
|
||||
value of split_loggers option is set to False. Operator can set it's
|
||||
value to True to split HTTP content into subloggers to allow for
|
||||
fine-grained control of what is logged and how. This new config option
|
||||
'split_loggers' should be enabled only when keystoneauth log level is
|
||||
set to DEBUG in 'default_log_levels' config option.
|
||||
|
||||
.. _`enable split logging`: https://docs.openstack.org/keystoneauth/latest/using-sessions.html#logging
|
Loading…
x
Reference in New Issue
Block a user