All Products
Search
Document Center

Object Storage Service:get-bucket-logging

Last Updated:Dec 30, 2024

Queries the logging configuration of a bucket.

Usage notes

By default, an Alibaba Cloud account has the permissions to query the logging configuration of a bucket. If you want to query the logging configuration of a bucket by using a RAM user or Security Token Service (STS), you must have the oss:GetBucketLogging permission. For more information, see Attach a custom policy to a RAM user.

Command syntax

ossutil api get-bucket-logging --bucket value [flags]

Parameter

Required

Description

--bucket

string

The name of the bucket.

Note

Examples

  • Query the logging configuration of a bucket named examplebucket.

    ossutil api get-bucket-logging --bucket examplebucket
  • Query the logging configuration of a bucket named examplebucket and display the response in JSON format.

    ossutil api get-bucket-logging --bucket examplebucket --output-format json
  • Query the logging configuration of a bucket named examplebucket and display the response in YAML format.

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