Merge "backup: set default swiftclient log level to WARN" into stable/pike

This commit is contained in:
Zuul 2018-02-04 00:34:45 +00:00 committed by Gerrit Code Review
commit c1d62a4f36
1 changed files with 9 additions and 0 deletions

View File

@ -47,12 +47,21 @@ from cinder import version
CONF = cfg.CONF
# NOTE(mriedem): The default backup driver uses swift and performs read/write
# operations in a thread. swiftclient will log requests and responses at DEBUG
# level, which can cause a thread switch and break the backup operation. So we
# set a default log level of WARN for swiftclient to try and avoid this issue.
_EXTRA_DEFAULT_LOG_LEVELS = ['swiftclient=WARN']
def main():
objects.register_all()
gmr_opts.set_defaults(CONF)
CONF(sys.argv[1:], project='cinder',
version=version.version_string())
logging.set_defaults(
default_log_levels=logging.get_default_log_levels() +
_EXTRA_DEFAULT_LOG_LEVELS)
logging.setup(CONF, "cinder")
python_logging.captureWarnings(True)
priv_context.init(root_helper=shlex.split(utils.get_root_helper()))