All Products
Search
Document Center

Object Storage Service:get-bucket-logging

Last Updated:Mar 20, 2026

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

ParameterTypeRequiredDescription
--bucketstringYesThe 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 examplebucket

Get the same response in JSON format:

ossutil api get-bucket-logging --bucket examplebucket --output-format json

Get the same response in YAML format:

ossutil api get-bucket-logging --bucket examplebucket --output-format yaml