From de6f5120510c73ff4de376f5a361d1293f1d68a6 Mon Sep 17 00:00:00 2001 From: Nicolas Simonds Date: Tue, 21 May 2013 16:25:11 -0700 Subject: [PATCH] Only add logging handlers if there currently aren't any This corrects an odd problem where Horizon would stand up multiple client objects, which would cause duplicate/triplicate/dozens of repeated log lines in its log files, due to multiple identical handlers being added to the logging object Fixes Bug 1182678 Change-Id: I020b3999c9008b996286ccb74a7801c96c43e71c --- keystoneclient/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keystoneclient/client.py b/keystoneclient/client.py index e3c2ed55b..b75ae540d 100644 --- a/keystoneclient/client.py +++ b/keystoneclient/client.py @@ -113,7 +113,7 @@ class HTTPClient(object): # logging setup self.debug_log = debug - if self.debug_log: + if self.debug_log and not _logger.handlers: ch = logging.StreamHandler() _logger.setLevel(logging.DEBUG) _logger.addHandler(ch)