• Object Storage Service

  1. Help Center
  2. Object Storage Service
  3. Developer Guide (Python SDK)
  4. Access Logging
  5. Disabling Bucket Logging

Disabling Bucket Logging

You can call ObsClient.setBucketLoggingConfiguration to clear logging settings of a bucket so as to disable logging of the bucket. Sample code is as follows:

# Import the module.
from com.obs.client.obs_client import ObsClient
# Create an instance of ObsClient.
obsClient = ObsClient(
    access_key_id='*** Provide your Access Key ***',    
    secret_access_key='*** Provide your Secret Key ***',    

from com.obs.models.logging import Logging
 # Leave the logging settings in blank.
resp = obsClient.setBucketLoggingConfiguration('bucketname', Logging())
if resp.status < 300:    
    print('requestId:', resp.requestId)
    print('errorCode:', resp.errorCode)    
    print('errorMessage:', resp.errorMessage)