• Object Storage Service

  1. Help Center
  2. Object Storage Service
  3. Developer Guide (Python SDK)
  4. Initialization
  5. Configuring SDK Logging

Configuring SDK Logging

OBS Python SDK provides the logging function. To enable this function, you can call the relevant API function to specify the path to the log configuration file. The procedure is as follows:

  1. Find the log.conf file in the OBS Python SDK.
  2. Modify parameters in log.conf as needed.
  3. Call ObsClient.initLog to enable the logging function. Sample code is as follows:

    # Import the log module.
    from com.obs.log.Log import LogConf
    # Specify the path to the log configuration file and initialize logs of ObsClient.
    obsClient.initLog(LogConf('./log.conf'), 'obs_logger');

  • The logging function is disabled by default. You need to enable it if needed.
  • For details about SDK logs, see Log Analysis.