diff --git a/etc/rally/rally.conf.sample b/etc/rally/rally.conf.sample index f6d2effe09..1f41ac6a83 100644 --- a/etc/rally/rally.conf.sample +++ b/etc/rally/rally.conf.sample @@ -61,7 +61,7 @@ # Log output to standard error. This option is ignored if # log_config_append is set. (boolean value) -#use_stderr = false +#use_stderr = true # Format string to use for log messages with context. (string value) #logging_context_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(user_identity)s] %(instance)s%(message)s diff --git a/rally/api.py b/rally/api.py index eb498894d7..20f2b7888e 100644 --- a/rally/api.py +++ b/rally/api.py @@ -1206,6 +1206,7 @@ class API(object): project="rally", version=rally_version.version_string(), default_config_files=config_files) + CONF.set_default("use_stderr", True) logging.setup("rally") if not CONF.get("log_config_append"): diff --git a/rally/common/opts.py b/rally/common/opts.py index d0dab4e588..e00ae5ac35 100644 --- a/rally/common/opts.py +++ b/rally/common/opts.py @@ -33,6 +33,13 @@ def list_opts(): return merged_opts.items() +def update_opt_defaults(): + logging.oslogging.cfg.set_defaults( + logging.oslogging._options.generic_log_opts, + use_stderr=True + ) + + _registered = False diff --git a/setup.cfg b/setup.cfg index 6d530e72de..a5dff1f7f3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -34,6 +34,8 @@ console_scripts = rally-manage = rally.cli.manage:main oslo.config.opts = rally = rally.common.opts:list_opts +oslo.config.opts.defaults = + rally = rally.common.opts:update_opt_defaults [global] setup-hooks =