Retrieves the logging configuration of a bucket, including whether logging is enabled, the target bucket where logs are stored, and the log object prefix.
Permissions
By default, an Alibaba Cloud account can query the logging configuration of a bucket without additional setup. To run this command as a RAM user or using Security Token Service (STS), the caller must have the oss:GetBucketLogging permission. For details, see Attach a custom policy to a RAM user.
Syntax
ossutil api get-bucket-logging --bucket <bucket-name> [flags]Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
--bucket | string | Yes | The name of the bucket. |
For global flags supported by all ossutil commands, see Global command-line options.
Note: This command corresponds to the GetBucketLogging API operation.
Examples
Query the logging configuration of examplebucket:
ossutil api get-bucket-logging --bucket examplebucketGet the same response in JSON format:
ossutil api get-bucket-logging --bucket examplebucket --output-format jsonGet the same response in YAML format:
ossutil api get-bucket-logging --bucket examplebucket --output-format yaml