• Object Storage Service

obs
  1. Help Center
  2. Object Storage Service
  3. API Reference (Python SDK)
  4. Initialization
  5. Log Initialization

Log Initialization

API Description

You can enable the SDK log function to record log information generated during API calling into log files for subsequent data analysis or fault location.

Method Definition

ObsClient.initLog(log_config, log_name)

Parameter Description

Field

Type

Optional or Mandatory

Description

log_config

LogConf

Mandatory

Log configuration parameter

log_name

str

Optional

Log name

Sample Code

# 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');