[cfg] Use stderr for logging by default

It is quite important for json-like output of results in CLI.

Change-Id: I0e2afdc165a7f65763597cb354d9c2acdcebdc07
This commit is contained in:
Andrey Kurilin 2018-02-14 19:31:27 +02:00
parent 2102b6eeea
commit aab953d055
4 changed files with 11 additions and 1 deletions

View File

@ -61,7 +61,7 @@
# Log output to standard error. This option is ignored if # Log output to standard error. This option is ignored if
# log_config_append is set. (boolean value) # log_config_append is set. (boolean value)
#use_stderr = false #use_stderr = true
# Format string to use for log messages with context. (string value) # 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 #logging_context_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(user_identity)s] %(instance)s%(message)s

View File

@ -1206,6 +1206,7 @@ class API(object):
project="rally", project="rally",
version=rally_version.version_string(), version=rally_version.version_string(),
default_config_files=config_files) default_config_files=config_files)
CONF.set_default("use_stderr", True)
logging.setup("rally") logging.setup("rally")
if not CONF.get("log_config_append"): if not CONF.get("log_config_append"):

View File

@ -33,6 +33,13 @@ def list_opts():
return merged_opts.items() return merged_opts.items()
def update_opt_defaults():
logging.oslogging.cfg.set_defaults(
logging.oslogging._options.generic_log_opts,
use_stderr=True
)
_registered = False _registered = False

View File

@ -34,6 +34,8 @@ console_scripts =
rally-manage = rally.cli.manage:main rally-manage = rally.cli.manage:main
oslo.config.opts = oslo.config.opts =
rally = rally.common.opts:list_opts rally = rally.common.opts:list_opts
oslo.config.opts.defaults =
rally = rally.common.opts:update_opt_defaults
[global] [global]
setup-hooks = setup-hooks =