diff options
| author | Abhishek Kekane <abhishek.kekane@nttdata.com> | 2016-04-21 11:28:32 +0000 |
|---|---|---|
| committer | Abhishek Kekane <abhishek.kekane@nttdata.com> | 2016-06-28 08:44:23 +0000 |
| commit | 679cdd245195a6d08cac859b49219ac9112f1d7c (patch) | |
| tree | 754f4ef13f2b540a60c3be8adc654eb97fd4f793 /cinderclient/v2 | |
| parent | d123164f3080659ee531e59af7475a6bd0b69130 (diff) | |
| download | python-cinderclient-679cdd245195a6d08cac859b49219ac9112f1d7c.tar.gz | |
Log request-id for each api call
Added new private method to log request-id of each api call
for both SessionClient and HTTPClient. Already available
ks_logger and client_logger will be used for SessionClient
and HTTPClient respectively.
Change-Id: I679c57b96071ecd9bcd1ab2ed50692195586ca52
Implements: blueprint log-request-id
Diffstat (limited to 'cinderclient/v2')
| -rw-r--r-- | cinderclient/v2/client.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/cinderclient/v2/client.py b/cinderclient/v2/client.py index 49b9651..c286a96 100644 --- a/cinderclient/v2/client.py +++ b/cinderclient/v2/client.py @@ -13,6 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. +import logging + from cinderclient import client from cinderclient import api_versions from cinderclient.v2 import availability_zones @@ -55,7 +57,8 @@ class Client(object): service_type='volumev2', service_name=None, volume_service_name=None, bypass_url=None, retries=None, http_log_debug=False, cacert=None, auth_system='keystone', - auth_plugin=None, session=None, api_version=None, **kwargs): + auth_plugin=None, session=None, api_version=None, + logger=None, **kwargs): # FIXME(comstud): Rename the api_key argument above when we # know it's not being used as keyword argument password = api_key @@ -93,6 +96,9 @@ class Client(object): setattr(self, extension.name, extension.manager_class(self)) + if not logger: + logger = logging.getLogger(__name__) + self.client = client._construct_http_client( username=username, password=password, @@ -116,6 +122,7 @@ class Client(object): auth_plugin=auth_plugin, session=session, api_version=self.api_version, + logger=logger, **kwargs) def authenticate(self): |
