diff --git a/cinderclient/client.py b/cinderclient/client.py index 314532423..fe20a6de9 100644 --- a/cinderclient/client.py +++ b/cinderclient/client.py @@ -212,12 +212,6 @@ class HTTPClient(CinderClientMixin): self.auth_plugin = auth_plugin self._logger = logging.getLogger(__name__) - if self.http_log_debug and not self._logger.handlers: - ch = logging.StreamHandler() - self._logger.setLevel(logging.DEBUG) - self._logger.addHandler(ch) - if hasattr(requests, 'logging'): - requests.logging.getLogger(requests.__name__).addHandler(ch) def http_log_req(self, args, kwargs): if not self.http_log_debug: diff --git a/cinderclient/shell.py b/cinderclient/shell.py index af166a02a..83242f31e 100644 --- a/cinderclient/shell.py +++ b/cinderclient/shell.py @@ -29,6 +29,8 @@ import os import pkgutil import sys +import requests + from cinderclient import client from cinderclient import exceptions as exc from cinderclient import utils @@ -478,6 +480,13 @@ class OpenStackCinderShell(object): logger.setLevel(logging.WARNING) logger.addHandler(streamhandler) + client_logger = logging.getLogger(client.__name__) + ch = logging.StreamHandler() + client_logger.setLevel(logging.DEBUG) + client_logger.addHandler(ch) + if hasattr(requests, 'logging'): + requests.logging.getLogger(requests.__name__).addHandler(ch) + def main(self, argv): # Parse args once to find version and debug settings