Merge "Fix needed for keystone middleware logging"

This commit is contained in:
Jenkins 2012-12-15 18:50:47 +00:00 committed by Gerrit Code Review
commit 7f6099707c

View File

@ -624,6 +624,11 @@ class SwiftLogFormatter(logging.Formatter):
"""
def format(self, record):
if not hasattr(record, 'server'):
# Catch log messages that were not initiated by swift
# (for example, the keystone auth middleware)
record.server = record.name
return logging.Formatter.format(self, record)
msg = logging.Formatter.format(self, record)
if (record.txn_id and record.levelno != logging.INFO and
record.txn_id not in msg):