Skip to content

Commit

Permalink
Update the log module from oslo-incubator
Browse files Browse the repository at this point in the history
Contains fix to stop the logger system from logging events twice.

Also includes PID in default logging_context_format_string

Fixes bug: 1170049

Change-Id: I007786604138c41fbcf1127c01339132c56a6aab
  • Loading branch information
Michael Kerrin committed Apr 18, 2013
1 parent d8e81f6 commit 6f91db5
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions nova/openstack/common/log.py
Expand Up @@ -112,9 +112,9 @@

log_opts = [
cfg.StrOpt('logging_context_format_string',
default='%(asctime)s.%(msecs)03d %(levelname)s %(name)s '
'[%(request_id)s %(user)s %(tenant)s] %(instance)s'
'%(message)s',
default='%(asctime)s.%(msecs)03d %(process)d %(levelname)s '
'%(name)s [%(request_id)s %(user)s %(tenant)s] '
'%(instance)s%(message)s',
help='format string to use for log messages with context'),
cfg.StrOpt('logging_default_format_string',
default='%(asctime)s.%(msecs)03d %(process)d %(levelname)s '
Expand Down Expand Up @@ -432,14 +432,11 @@ def _setup_logging_from_conf():
else:
log_root.setLevel(logging.WARNING)

level = logging.NOTSET
for pair in CONF.default_log_levels:
mod, _sep, level_name = pair.partition('=')
level = logging.getLevelName(level_name)
logger = logging.getLogger(mod)
logger.setLevel(level)
for handler in log_root.handlers:
logger.addHandler(handler)

_loggers = {}

Expand Down

0 comments on commit 6f91db5

Please sign in to comment.