Log lines originating in keystone.common.wsgi are doubled in log files
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Identity (keystone) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Log lines appear to be doubled up after a certain point in the keystone log output:
http://
which makes debugging quite difficult :)
There's nothing particularly strange about my keystone.conf:
[DEFAULT]
public_port = 5000
admin_port = 35357
admin_token = 999888777666
bind_host = 192.168.128.11
compute_port = 8774
verbose = False
debug = true
log_config = /etc/keystone/
# ================= Syslog Options =======
# Send logs to syslog (/dev/log) instead of to file specified
# by `log-file`
use_syslog = false
# Facility to use. If unset defaults to LOG_LOCAL2
syslog_log_facility = LOG_LOCAL3
and in keystone/
[loggers]
keys=root,
[formatters]
keys=normal,
[handlers]
keys=production
[logger_root]
level=NOTSET
handlers=file
[logger_keystone]
level=DEBUG
handlers=file
qualname=keystone
[logger_combined]
level=DEBUG
handlers=file
qualname=
[handler_
class=handlers.
level=ERROR
formatter=
args=(('localhost', handlers.
[handler_file]
class=FileHandler
level=DEBUG
formatter=
args=('
[handler_devel]
class=StreamHandler
level=NOTSET
formatter=debug
args=(sys.stdout,)
[formatter_normal]
format=%(asctime)s %(levelname)s %(message)s
[formatter_
format=(%(name)s): %(asctime)s %(levelname)s %(message)s
[formatter_debug]
format=(%(name)s): %(asctime)s %(levelname)s %(module)s %(funcName)s %(message)s
Any ideas on why this might be happening?
i believe the issue is that both root logger and keystone loggers use the file handler
from python docs (http:// docs.python. org/2/library/ logging. html), you shouldn't need to attach handler to more than one logger:
Note: If you attach a handler to a logger and one or more of its ancestors, it may emit the same record multiple times. In general, you should not need to attach a handler to more than one logger - if you just attach it to the appropriate logger which is highest in the logger hierarchy, then it will see all events logged by all descendant loggers, provided that their propagate setting is left set to True. A common scenario is to attach handlers only to the root logger, and to let propagation take care of the rest.