diff --git a/config-generator.conf b/config-generator.conf index abede34..075042b 100644 --- a/config-generator.conf +++ b/config-generator.conf @@ -2,4 +2,4 @@ output_file = etc/shaker.conf wrap_width = 79 namespace = shaker.engine.config -namespace = shaker.openstack.common.log +namespace = oslo_log diff --git a/etc/shaker.conf b/etc/shaker.conf index 47e1a48..793d628 100644 --- a/etc/shaker.conf +++ b/etc/shaker.conf @@ -1,5 +1,88 @@ [DEFAULT] +# +# From oslo_log +# + +# Print debugging output (set logging level to DEBUG instead of default WARNING +# level). (boolean value) +#debug = false + +# Print more verbose output (set logging level to INFO instead of default +# WARNING level). (boolean value) +#verbose = false + +# The name of a logging configuration file. This file is appended to any +# existing logging configuration files. For details about logging configuration +# files, see the Python logging module documentation. (string value) +# Deprecated group/name - [DEFAULT]/log_config +#log_config_append = + +# DEPRECATED. A logging.Formatter log message format string which may use any +# of the available logging.LogRecord attributes. This option is deprecated. +# Please use logging_context_format_string and logging_default_format_string +# instead. (string value) +#log_format = + +# Format string for %%(asctime)s in log records. Default: %(default)s . (string +# value) +#log_date_format = %Y-%m-%d %H:%M:%S + +# (Optional) Name of log file to output to. If no default is set, logging will +# go to stdout. (string value) +# Deprecated group/name - [DEFAULT]/logfile +#log_file = + +# (Optional) The base directory used for relative --log-file paths. (string +# value) +# Deprecated group/name - [DEFAULT]/logdir +#log_dir = + +# Use syslog for logging. Existing syslog format is DEPRECATED during I, and +# will change in J to honor RFC5424. (boolean value) +#use_syslog = false + +# (Optional) Enables or disables syslog rfc5424 format for logging. If enabled, +# prefixes the MSG part of the syslog message with APP-NAME (RFC5424). The +# format without the APP-NAME is deprecated in I, and will be removed in J. +# (boolean value) +#use_syslog_rfc_format = false + +# Syslog facility to receive log lines. (string value) +#syslog_log_facility = LOG_USER + +# Log output to standard error. (boolean value) +#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 + +# Format string to use for log messages without context. (string value) +#logging_default_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [-] %(instance)s%(message)s + +# Data to append to log format when level is DEBUG. (string value) +#logging_debug_format_suffix = %(funcName)s %(pathname)s:%(lineno)d + +# Prefix each line of exception output with this format. (string value) +#logging_exception_prefix = %(asctime)s.%(msecs)03d %(process)d TRACE %(name)s %(instance)s + +# List of logger=LEVEL pairs. (list value) +#default_log_levels = amqp=WARN,amqplib=WARN,boto=WARN,qpid=WARN,sqlalchemy=WARN,suds=INFO,oslo.messaging=INFO,iso8601=WARN,requests.packages.urllib3.connectionpool=WARN,urllib3.connectionpool=WARN,websocket=WARN,keystonemiddleware=WARN,routes.middleware=WARN,stevedore=WARN + +# Enables or disables publication of error events. (boolean value) +#publish_errors = false + +# Enables or disables fatal status of deprecations. (boolean value) +#fatal_deprecations = false + +# The format for an instance that is passed with the log message. (string +# value) +#instance_format = "[instance: %(uuid)s] " + +# The format for an instance UUID that is passed with the log message. (string +# value) +#instance_uuid_format = "[instance: %(uuid)s] " + # # From shaker.engine.config # @@ -46,7 +129,7 @@ #scenario = # Report template in Jinja format (string value) -#report_template = shaker/resources/report_template.html +#report_template = shaker/resources/report_template.jinja2 # Report file name. If not specified print to stdout (string value) #report = @@ -64,98 +147,3 @@ # Heat template for the image builder. (string value) #image_builder_template = shaker/resources/image_builder_template.yaml - -# -# From shaker.openstack.common.log -# - -# Print debugging output (set logging level to DEBUG instead of default WARNING -# level). (boolean value) -#debug = false - -# Print more verbose output (set logging level to INFO instead of default -# WARNING level). (boolean value) -#verbose = false - -# -# From shaker.openstack.common.log -# - -# The name of a logging configuration file. This file is appended to any -# existing logging configuration files. For details about logging configuration -# files, see the Python logging module documentation. (string value) -# Deprecated group/name - [DEFAULT]/log_config -#log_config_append = - -# DEPRECATED. A logging.Formatter log message format string which may use any -# of the available logging.LogRecord attributes. This option is deprecated. -# Please use logging_context_format_string and logging_default_format_string -# instead. (string value) -#log_format = - -# Format string for %%(asctime)s in log records. Default: %(default)s . (string -# value) -#log_date_format = %Y-%m-%d %H:%M:%S - -# (Optional) Name of log file to output to. If no default is set, logging will -# go to stdout. (string value) -# Deprecated group/name - [DEFAULT]/logfile -#log_file = - -# (Optional) The base directory used for relative --log-file paths. (string -# value) -# Deprecated group/name - [DEFAULT]/logdir -#log_dir = - -# Use syslog for logging. Existing syslog format is DEPRECATED during I, and -# will change in J to honor RFC5424. (boolean value) -#use_syslog = false - -# (Optional) Enables or disables syslog rfc5424 format for logging. If enabled, -# prefixes the MSG part of the syslog message with APP-NAME (RFC5424). The -# format without the APP-NAME is deprecated in I, and will be removed in J. -# (boolean value) -#use_syslog_rfc_format = false - -# Syslog facility to receive log lines. (string value) -#syslog_log_facility = LOG_USER - -# -# From shaker.openstack.common.log -# - -# Log output to standard error. (boolean value) -#use_stderr = true - -# -# From shaker.openstack.common.log -# - -# 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 - -# Format string to use for log messages without context. (string value) -#logging_default_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [-] %(instance)s%(message)s - -# Data to append to log format when level is DEBUG. (string value) -#logging_debug_format_suffix = %(funcName)s %(pathname)s:%(lineno)d - -# Prefix each line of exception output with this format. (string value) -#logging_exception_prefix = %(asctime)s.%(msecs)03d %(process)d TRACE %(name)s %(instance)s - -# List of logger=LEVEL pairs. (list value) -#default_log_levels = amqp=WARN,amqplib=WARN,boto=WARN,qpid=WARN,sqlalchemy=WARN,suds=INFO,oslo.messaging=INFO,iso8601=WARN,requests.packages.urllib3.connectionpool=WARN,urllib3.connectionpool=WARN,websocket=WARN,keystonemiddleware=WARN,routes.middleware=WARN,stevedore=WARN - -# Enables or disables publication of error events. (boolean value) -#publish_errors = false - -# Enables or disables fatal status of deprecations. (boolean value) -#fatal_deprecations = false - -# The format for an instance that is passed with the log message. (string -# value) -#instance_format = "[instance: %(uuid)s] " - -# The format for an instance UUID that is passed with the log message. (string -# value) -#instance_uuid_format = "[instance: %(uuid)s] " diff --git a/setup.cfg b/setup.cfg index 2ad60cf..c363ef1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -30,7 +30,7 @@ console_scripts = shaker-cleanup = shaker.engine.image_builder:cleanup oslo.config.opts = - shaker.openstack.common.log = shaker.openstack.common.log:list_opts + oslo_log = oslo_log._options:list_opts shaker.engine.config = shaker.engine.config:list_opts [build_sphinx] diff --git a/shaker/agent/agent.py b/shaker/agent/agent.py index 7759fcf..ec1bf6c 100644 --- a/shaker/agent/agent.py +++ b/shaker/agent/agent.py @@ -60,6 +60,8 @@ def main(): conf.register_cli_opts(config.AGENT_OPTS) conf.register_opts(config.COMMON_OPTS) conf.register_opts(config.AGENT_OPTS) + logging.register_options(conf) + logging.set_defaults() try: conf(project='shaker') @@ -68,7 +70,7 @@ def main(): conf.print_usage() exit(1) - logging.setup('shaker') + logging.setup(conf, 'shaker') LOG.info('Logging enabled') endpoint = cfg.CONF.server_endpoint diff --git a/shaker/engine/config.py b/shaker/engine/config.py index 98e3156..9a13407 100644 --- a/shaker/engine/config.py +++ b/shaker/engine/config.py @@ -64,7 +64,7 @@ SERVER_OPTS = [ help='Scenario file name'), cfg.StrOpt('report-template', - default='shaker/resources/report_template.html', + default='shaker/resources/report_template.jinja2', help='Report template in Jinja format'), cfg.StrOpt('report', help='Report file name. If not specified print to stdout'), diff --git a/shaker/engine/image_builder.py b/shaker/engine/image_builder.py index c9c891c..bc7c25c 100644 --- a/shaker/engine/image_builder.py +++ b/shaker/engine/image_builder.py @@ -37,9 +37,11 @@ def init(): conf.register_cli_opts(config.IMAGE_BUILDER_OPTS) conf.register_opts(config.OPENSTACK_OPTS) conf.register_opts(config.IMAGE_BUILDER_OPTS) + logging.register_options(conf) + logging.set_defaults() conf(project='shaker') - logging.setup('shaker') + logging.setup(conf, 'shaker') LOG.info('Logging enabled') openstack_client = openstack.OpenStackClient( diff --git a/shaker/engine/server.py b/shaker/engine/server.py index e127db7..80b20eb 100644 --- a/shaker/engine/server.py +++ b/shaker/engine/server.py @@ -203,6 +203,8 @@ def main(): conf.register_opts(config.COMMON_OPTS) conf.register_opts(config.OPENSTACK_OPTS) conf.register_opts(config.SERVER_OPTS) + logging.register_options(conf) + logging.set_defaults() try: conf(project='shaker') @@ -211,7 +213,7 @@ def main(): conf.print_usage() exit(1) - logging.setup('shaker') + logging.setup(conf, 'shaker') LOG.info('Logging enabled') scenario = read_scenario() diff --git a/shaker/openstack/clients/heat.py b/shaker/openstack/clients/heat.py index 11ef42d..fe1a9ed 100644 --- a/shaker/openstack/clients/heat.py +++ b/shaker/openstack/clients/heat.py @@ -16,8 +16,7 @@ import time from heatclient import client as heat_client_pkg - -from shaker.openstack.common import log as logging +from oslo_log import log as logging LOG = logging.getLogger(__name__) diff --git a/shaker/openstack/clients/neutron.py b/shaker/openstack/clients/neutron.py index 71b482f..bf63f70 100644 --- a/shaker/openstack/clients/neutron.py +++ b/shaker/openstack/clients/neutron.py @@ -14,8 +14,7 @@ # limitations under the License. from neutronclient.neutron import client as neutron_client_pkg - -from shaker.openstack.common import log as logging +from oslo_log import log as logging LOG = logging.getLogger(__name__) diff --git a/shaker/openstack/clients/nova.py b/shaker/openstack/clients/nova.py index f36d4cb..fef25a5 100644 --- a/shaker/openstack/clients/nova.py +++ b/shaker/openstack/clients/nova.py @@ -16,8 +16,7 @@ import time from novaclient import client as nova_client_pkg - -from shaker.openstack.common import log as logging +from oslo_log import log as logging LOG = logging.getLogger(__name__) diff --git a/shaker/resources/report_template.html b/shaker/resources/report_template.jinja2 similarity index 100% rename from shaker/resources/report_template.html rename to shaker/resources/report_template.jinja2