Python oslo_log.log.get_default_log_levels() Examples
The following are 12
code examples of oslo_log.log.get_default_log_levels().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
oslo_log.log
, or try the search function
.
Example #1
Source File: config.py From masakari with Apache License 2.0 | 6 votes |
def parse_args(argv, default_config_files=None, configure_db=True, init_rpc=True): log.register_options(CONF) # We use the oslo.log default log levels which includes suds=INFO # and add only the extra levels that Masakari needs log.set_defaults(default_log_levels=log.get_default_log_levels()) rpc.set_defaults(control_exchange='masakari') config.set_middleware_defaults() CONF(argv[1:], project='masakari', version=version.version_string(), default_config_files=default_config_files) if init_rpc: rpc.init(CONF) if configure_db: sqlalchemy_api.configure(CONF)
Example #2
Source File: config.py From kuryr-kubernetes with Apache License 2.0 | 5 votes |
def setup_logging(): logging.setup(CONF, 'kuryr-kubernetes') logging.set_defaults(default_log_levels=logging.get_default_log_levels()) version_k8s = version.version_info.version_string() LOG.info("Logging enabled!") LOG.info("%(prog)s version %(version)s", {'prog': sys.argv[0], 'version': version_k8s})
Example #3
Source File: config.py From octavia with Apache License 2.0 | 5 votes |
def setup_logging(conf): """Sets up the logging options for a log with supplied name. :param conf: a cfg.ConfOpts object """ logging.set_defaults(default_log_levels=logging.get_default_log_levels() + EXTRA_LOG_LEVEL_DEFAULTS) product_name = "octavia" logging.setup(conf, product_name) LOG.info("Logging enabled!") LOG.info("%(prog)s version %(version)s", {'prog': sys.argv[0], 'version': version.version_info.release_string()}) LOG.debug("command line: %s", " ".join(sys.argv))
Example #4
Source File: __init__.py From armada with Apache License 2.0 | 5 votes |
def set_default_for_default_log_levels(): """Set the default for the default_log_levels option for Armada. Armada uses some packages that other OpenStack services don't use that do logging. This will set the default_log_levels default level for those packages. This function needs to be called before CONF(). """ extra_log_level_defaults = ['kubernetes.client.rest=INFO'] log.set_defaults( default_log_levels=log.get_default_log_levels() + extra_log_level_defaults, )
Example #5
Source File: __init__.py From armada with Apache License 2.0 | 5 votes |
def set_default_for_default_log_levels(): """Set the default for the default_log_levels option for Armada. Armada uses some packages that other OpenStack services don't use that do logging. This will set the default_log_levels default level for those packages. This function needs to be called before CONF(). """ extra_log_level_defaults = [ 'kubernetes.client.rest=INFO' ] log.set_defaults( default_log_levels=log.get_default_log_levels() + extra_log_level_defaults)
Example #6
Source File: masakari_config.py From masakari with Apache License 2.0 | 5 votes |
def set_request_context(self): level = self.conf_log.get('log_level') logging.set_defaults( logging_context_format_string=self.conf_log.get( "logging_context_format_string"), default_log_levels=logging.get_default_log_levels() + ['controller=' + level]) context.RequestContext() return
Example #7
Source File: test_log.py From oslo.log with Apache License 2.0 | 5 votes |
def test_default_log_level_method(self): self.assertEqual(_options.DEFAULT_LOG_LEVELS, log.get_default_log_levels())
Example #8
Source File: usage_context.py From oslo.log with Apache License 2.0 | 5 votes |
def prepare(): """Prepare Oslo Logging (2 or 3 steps) Use of Oslo Logging involves the following: * logging.register_options * logging.set_defaults (optional) * logging.setup """ # Required step to register common, logging and generic configuration # variables logging.register_options(CONF) # Optional step to set new defaults if necessary for # * logging_context_format_string # * default_log_levels # # These variables default to respectively: # # import oslo_log # oslo_log._options.DEFAULT_LOG_LEVELS # oslo_log._options.log_opts[0].default # extra_log_level_defaults = [ 'dogpile=INFO', 'routes=INFO' ] logging.set_defaults( default_log_levels=logging.get_default_log_levels() + extra_log_level_defaults) # Required setup based on configuration and domain logging.setup(CONF, DOMAIN)
Example #9
Source File: usage.py From oslo.log with Apache License 2.0 | 5 votes |
def prepare(): """Prepare Oslo Logging (2 or 3 steps) Use of Oslo Logging involves the following: * logging.register_options * logging.set_defaults (optional) * logging.setup """ # Required step to register common, logging and generic configuration # variables logging.register_options(CONF) # Optional step to set new defaults if necessary for # * logging_context_format_string # * default_log_levels # # These variables default to respectively: # # import oslo_log # oslo_log._options.DEFAULT_LOG_LEVELS # oslo_log._options.log_opts[0].default # extra_log_level_defaults = [ 'dogpile=INFO', 'routes=INFO' ] logging.set_defaults( default_log_levels=logging.get_default_log_levels() + extra_log_level_defaults) # Required setup based on configuration and domain logging.setup(CONF, DOMAIN)
Example #10
Source File: config.py From monasca-notification with Apache License 2.0 | 5 votes |
def parse_args(argv): """Sets up configuration of monasca-notification.""" global _CONF_LOADED if _CONF_LOADED: LOG.debug('Configuration has been already loaded') return conf.register_opts(CONF) log.register_options(CONF) default_log_levels = (log.get_default_log_levels()) log.set_defaults(default_log_levels=default_log_levels) CONF(args=argv, project='monasca', prog=sys.argv[1:], version=version.version_string, default_config_files=_get_config_files(), description=''' monasca-notification is an engine responsible for transforming alarm transitions into proper notifications ''') conf.register_enabled_plugin_opts(CONF) log.setup(CONF, product_name='monasca-notification', version=version.version_string) _CONF_LOADED = True
Example #11
Source File: config.py From qinling with Apache License 2.0 | 5 votes |
def parse_args(args=None, usage=None, default_config_files=None): CLI_OPTS = [launch_opt] CONF.register_cli_opts(CLI_OPTS) for group, options in list_opts(): CONF.register_opts(list(options), group) _DEFAULT_LOG_LEVELS = [ 'eventlet.wsgi.server=WARN', 'oslo_service.periodic_task=INFO', 'oslo_service.loopingcall=INFO', 'oslo_db=WARN', 'oslo_concurrency.lockutils=WARN', 'kubernetes.client.rest=%s' % CONF.kubernetes.log_devel, 'keystoneclient=INFO', 'requests.packages.urllib3.connectionpool=CRITICAL', 'urllib3.connectionpool=CRITICAL', 'cotyledon=INFO', 'futurist.periodics=WARN' ] default_log_levels = log.get_default_log_levels() default_log_levels.extend(_DEFAULT_LOG_LEVELS) log.set_defaults(default_log_levels=default_log_levels) log.register_options(CONF) CONF( args=args, project='qinling', version=version, usage=usage, default_config_files=default_config_files )
Example #12
Source File: usage_helper.py From oslo.log with Apache License 2.0 | 4 votes |
def prepare(): """Prepare Oslo Logging (2 or 3 steps) Use of Oslo Logging involves the following: * logging.register_options * logging.set_defaults (optional) * logging.setup """ LOG.debug("Prepare Oslo Logging") LOG.info("Size of configuration options before %d", len(CONF)) # Required step to register common, logging and generic configuration # variables logging.register_options(CONF) LOG.info("Size of configuration options after %d", len(CONF)) # Optional step to set new defaults if necessary for # * logging_context_format_string # * default_log_levels # # These variables default to respectively: # # import oslo_log # oslo_log._options.DEFAULT_LOG_LEVELS # oslo_log._options.log_opts[0].default # custom_log_level_defaults = logging.get_default_log_levels() + [ 'dogpile=INFO', 'routes=INFO' ] logging.set_defaults(default_log_levels=custom_log_level_defaults) # NOTE: We cannot show the contents of the CONF object # after register_options() because accessing this caches # the default_log_levels subsequently modified with set_defaults() LOG.info("List of Oslo Logging configuration options and current values") LOG.info("=" * 80) for c in CONF: LOG.info("%s = %s" % (c, CONF[c])) LOG.info("=" * 80) # Required setup based on configuration and domain logging.setup(CONF, DOMAIN)