Don't use pecan to configure logging

Fixes bug #1184941

openstack.common.log gives a mechanism to configure logging and, by
default, we will set up a handler on root logger. Using pecan to also
configure a handler on the 'ironic' logger means every log message gets
logged to console twice.

It seems that the pecan logging configuration stuff is redundant with
our existing logging configuration infrastructure.

Change-Id: Iec0630b0e842e3b6a90021bf552d9b857c5a0552
This commit is contained in:
Mark McLoughlin 2013-05-28 11:18:13 +01:00
parent 2fcd26397a
commit e6a083fc5a
3 changed files with 1 additions and 48 deletions

View File

@ -61,8 +61,7 @@ def setup_app(pecan_config=None, extra_hooks=None):
pecan_config.app.root,
static_root=pecan_config.app.static_root,
template_path=pecan_config.app.template_path,
logging=getattr(pecan_config, 'logging', {}),
debug=getattr(pecan_config.app, 'debug', False),
debug=CONF.debug,
force_canonical=getattr(pecan_config.app, 'force_canonical', True),
hooks=app_hooks,
wrap_app=middleware.ParsableErrorMiddleware,
@ -77,7 +76,6 @@ def setup_app(pecan_config=None, extra_hooks=None):
class VersionSelectorApplication(object):
def __init__(self):
pc = get_pecan_config()
pc.app.debug = CONF.debug
pc.app.enable_acl = (CONF.auth_strategy == 'keystone')
if cfg.CONF.enable_v1_api:
from ceilometer.api.v1 import app as v1app

View File

@ -14,27 +14,6 @@ app = {
'enable_acl': True,
}
logging = {
'loggers': {
'root': {'level': 'INFO', 'handlers': ['console']},
'ceilometer': {'level': 'DEBUG', 'handlers': ['console']},
'wsme': {'level': 'DEBUG', 'handlers': ['console']}
},
'handlers': {
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'simple'
}
},
'formatters': {
'simple': {
'format': ('%(asctime)s %(levelname)-5.5s [%(name)s]'
'[%(threadName)s] %(message)s')
}
},
}
# Custom Configurations must be in Python dictionary format::
#
# foo = {'bar':'baz'}

View File

@ -95,7 +95,6 @@ class FunctionalTest(db_test_base.TestBase):
root_dir = self.path_get()
self.config = {
'app': {
'root': 'ceilometer.api.controllers.root.RootController',
'modules': ['ceilometer.api'],
@ -103,29 +102,6 @@ class FunctionalTest(db_test_base.TestBase):
'template_path': '%s/ceilometer/api/templates' % root_dir,
'enable_acl': enable_acl,
},
'logging': {
'loggers': {
'root': {'level': 'DEBUG', 'handlers': ['console']},
'wsme': {'level': 'DEBUG', 'handlers': ['console']},
'ceilometer': {'level': 'DEBUG',
'handlers': ['console'],
},
},
'handlers': {
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'simple'
}
},
'formatters': {
'simple': {
'format': ('%(asctime)s %(levelname)-5.5s [%(name)s]'
'[%(threadName)s] %(message)s')
}
},
},
}
return pecan.testing.load_test_app(self.config)