Merge "Make config generator aware of 'default_log_levels' override"

This commit is contained in:
Jenkins 2017-04-18 14:46:57 +00:00 committed by Gerrit Code Review
commit b0c63477d1
4 changed files with 30 additions and 18 deletions

View File

@ -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)

View File

@ -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

View File

@ -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',
]
)

View File

@ -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