diff --git a/glance/cmd/cache_cleaner.py b/glance/cmd/cache_cleaner.py index 640f62dcdc..bb2a54d545 100644 --- a/glance/cmd/cache_cleaner.py +++ b/glance/cmd/cache_cleaner.py @@ -47,6 +47,7 @@ from glance.image_cache import cleaner CONF = config.CONF logging.register_options(CONF) +CONF.set_default(name='use_stderr', default=True, enforce_type=True) def main(): diff --git a/glance/cmd/cache_prefetcher.py b/glance/cmd/cache_prefetcher.py index d35d5edc21..f22600e3f7 100644 --- a/glance/cmd/cache_prefetcher.py +++ b/glance/cmd/cache_prefetcher.py @@ -41,6 +41,7 @@ from glance.image_cache import prefetcher CONF = config.CONF logging.register_options(CONF) +CONF.set_default(name='use_stderr', default=True, enforce_type=True) def main(): diff --git a/glance/cmd/cache_pruner.py b/glance/cmd/cache_pruner.py index 6c08f9bae7..4e4aa9bee6 100644 --- a/glance/cmd/cache_pruner.py +++ b/glance/cmd/cache_pruner.py @@ -39,6 +39,7 @@ from glance.image_cache import pruner CONF = config.CONF logging.register_options(CONF) +CONF.set_default(name='use_stderr', default=True, enforce_type=True) def main(): diff --git a/glance/cmd/manage.py b/glance/cmd/manage.py index 390729fb99..6bff4e30b8 100644 --- a/glance/cmd/manage.py +++ b/glance/cmd/manage.py @@ -313,6 +313,7 @@ def main(): try: logging.register_options(CONF) + CONF.set_default(name='use_stderr', default=True, enforce_type=True) cfg_files = cfg.find_config_files(project='glance', prog='glance-registry') cfg_files.extend(cfg.find_config_files(project='glance', diff --git a/glance/cmd/replicator.py b/glance/cmd/replicator.py index 01da00a2cc..0bfb54626e 100644 --- a/glance/cmd/replicator.py +++ b/glance/cmd/replicator.py @@ -81,6 +81,7 @@ cli_opts = [ CONF = cfg.CONF CONF.register_cli_opts(cli_opts) logging.register_options(CONF) +CONF.set_default(name='use_stderr', default=True, enforce_type=True) # If ../glance/__init__.py exists, add ../ to Python search path, so that # it will override what happens to be installed in /usr/(local/)lib/python... diff --git a/glance/cmd/scrubber.py b/glance/cmd/scrubber.py index 1d2fa4c7eb..8eadb4ee98 100644 --- a/glance/cmd/scrubber.py +++ b/glance/cmd/scrubber.py @@ -43,6 +43,7 @@ eventlet.patcher.monkey_patch(all=False, socket=True, time=True, select=True, CONF = cfg.CONF logging.register_options(CONF) +CONF.set_default(name='use_stderr', default=True, enforce_type=True) def main(): diff --git a/releasenotes/notes/oslo-log-use-stderr-changes-07f5daf3e6abdcd6.yaml b/releasenotes/notes/oslo-log-use-stderr-changes-07f5daf3e6abdcd6.yaml new file mode 100644 index 0000000000..bac88758a8 --- /dev/null +++ b/releasenotes/notes/oslo-log-use-stderr-changes-07f5daf3e6abdcd6.yaml @@ -0,0 +1,14 @@ +--- +upgrade: + - A recent change to oslo.log (>= 3.17.0) set the default value + of ``[DEFAULT]/use_stderr`` to ``False`` in order to produce + duplication of logs (as reported in bug \#1588051). Since this + would change the current behaviour of certain glance commands + (e.g., glance-replicator, glance-cache-manage, etc.), we chose to + override the default value of ``use_stderr`` to ``True`` in those + commands. We also chose not to override that value in any Glance + service (e.g., glance-api, glance-registry) so that duplicate + logs are not created by those services. Operators that have a + usecase that relies on logs being reported on standard error may + set ``[DEFAULT]/use_stderr = True`` in the appropriate service's + configuration file upon deployment.