diff --git a/etc/ironic/ironic.conf.sample b/etc/ironic/ironic.conf.sample index 55b72b26e6..06722e2ee9 100644 --- a/etc/ironic/ironic.conf.sample +++ b/etc/ironic/ironic.conf.sample @@ -463,7 +463,7 @@ # List of package logging levels in logger=LEVEL pairs. This # option is ignored if log_config_append is set. (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,requests.packages.urllib3.util.retry=WARN,urllib3.util.retry=WARN,keystonemiddleware=WARN,routes.middleware=WARN,stevedore=WARN,taskflow=WARN,keystoneauth=WARN,oslo.cache=INFO,dogpile.core.dogpile=INFO +#default_log_levels = amqp=WARNING,amqplib=WARNING,qpid.messaging=INFO,oslo_messaging=INFO,sqlalchemy=WARNING,stevedore=INFO,eventlet.wsgi.server=INFO,iso8601=WARNING,paramiko=WARNING,requests=WARNING,neutronclient=WARNING,glanceclient=WARNING,urllib3.connectionpool=WARNING,keystonemiddleware.auth_token=INFO,keystoneauth.session=INFO # Enables or disables publication of error events. (boolean # value) diff --git a/ironic/common/service.py b/ironic/common/service.py index 7052b7b050..a077889bb4 100644 --- a/ironic/common/service.py +++ b/ironic/common/service.py @@ -19,29 +19,14 @@ from oslo_service import service from ironic.common import config from ironic.conf import CONF +from ironic.conf import opts from ironic import objects def prepare_service(argv=None): argv = [] if argv is None else argv log.register_options(CONF) - log.set_defaults(default_log_levels=[ - 'amqp=WARNING', - 'amqplib=WARNING', - 'qpid.messaging=INFO', - 'oslo_messaging=INFO', - 'sqlalchemy=WARNING', - 'stevedore=INFO', - 'eventlet.wsgi.server=INFO', - 'iso8601=WARNING', - 'paramiko=WARNING', - 'requests=WARNING', - 'neutronclient=WARNING', - 'glanceclient=WARNING', - 'urllib3.connectionpool=WARNING', - 'keystonemiddleware.auth_token=INFO', - 'keystoneauth.session=INFO', - ]) + opts.update_opt_defaults() config.parse_args(argv) # NOTE(vdrok): We need to setup logging after argv was parsed, otherwise # it does not properly parse the options from config file and uses defaults diff --git a/ironic/conf/opts.py b/ironic/conf/opts.py index d891f0f69a..c670ccb4ba 100644 --- a/ironic/conf/opts.py +++ b/ironic/conf/opts.py @@ -12,6 +12,8 @@ import itertools +from oslo_log import log + import ironic.conf _default_opt_lists = [ @@ -78,3 +80,25 @@ def list_opts(): :returns: a list of (group, options) tuples """ return _opts + + +def update_opt_defaults(): + log.set_defaults( + default_log_levels=[ + 'amqp=WARNING', + 'amqplib=WARNING', + 'qpid.messaging=INFO', + 'oslo_messaging=INFO', + 'sqlalchemy=WARNING', + 'stevedore=INFO', + 'eventlet.wsgi.server=INFO', + 'iso8601=WARNING', + 'paramiko=WARNING', + 'requests=WARNING', + 'neutronclient=WARNING', + 'glanceclient=WARNING', + 'urllib3.connectionpool=WARNING', + 'keystonemiddleware.auth_token=INFO', + 'keystoneauth.session=INFO', + ] + ) diff --git a/setup.cfg b/setup.cfg index c2663ecf05..aaeaa0d146 100644 --- a/setup.cfg +++ b/setup.cfg @@ -25,6 +25,9 @@ packages = oslo.config.opts = ironic = ironic.conf.opts:list_opts +oslo.config.opts.defaults = + ironic = ironic.conf.opts:update_opt_defaults + oslo.policy.enforcer = ironic = ironic.common.policy:get_oslo_policy_enforcer