API | Operation Name | Operation Description |
Setting log management | Enables logging for the source bucket | |
Querying log management | Queries the logging configuration information of the source bucket |
public void setBucketLoggingConfiguration(SetBucketLoggingConfigurationRequest setBucketLoggingConfigurationRequest);
String bucketName = "examplebucket-1250000000";BucketLoggingConfiguration bucketLoggingConfiguration = new BucketLoggingConfiguration();bucketLoggingConfiguration.setDestinationBucketName(bucketName);bucketLoggingConfiguration.setLogFilePrefix("logs");SetBucketLoggingConfigurationRequest setBucketLoggingConfigurationRequest = new SetBucketLoggingConfigurationRequest(bucketName, bucketLoggingConfiguration);cosclient.setBucketLoggingConfiguration(setBucketLoggingConfigurationRequest);
Parameter Name | Description | Type |
setBucketLoggingConfigurationRequest | Request to enable logging feature | SetBucketLoggingConfigurationRequest |
Request member description:Request Member | Setting Method | Description | Type |
bucketName | Constructor or set method | Source bucket for which to enable the logging feature in the format of BucketName-APPID. For more information, please see Naming Convention | String |
loggingConfiguration | Constructor or set method | Bucket logging feature configuration | BucketLoggingConfiguration |
BucketLoggingConfiguration member description:Parameter Name | Description | Type |
destinationBucketName | Destination bucket where to store logs in the format of BucketName-APPID. For more information, please see Naming Convention | String |
logFilePrefix | Specified path in the destination bucket for storing logs | String |
CosClientException or CosServiceException exception was thrown. For more information, please see Troubleshooting.public BucketLoggingConfiguration getBucketLoggingConfiguration(String bucketName);
String bucketName = "examplebucket-1250000000";BucketLoggingConfiguration bucketLoggingConfiguration = cosclient.getBucketLoggingConfiguration(bucketName);
Parameter Name | Description | Type |
bucketName | Destination bucket where to store logs in the format of BucketName-APPID. For more information, please see Naming Convention | String |
BucketLoggingConfiguration is returned, which contains the name of the destination bucket and specified path in the destination bucket for storing logsCosClientException or CosServiceException exception was thrown. For more information, please see Troubleshooting.Feedback