GetBucketLogging
Updated at:2025-11-03
API description
This API retrieves the access log configuration of a bucket.
Request
-
Request syntax
Plain Text1Get /?logging HTTP/1.1 2Host: <BucketName>.bj.bcebos.com 3Date: <Date> 4Authorization: <AuthorizationString> 5Content-Length: 0 -
Request headers
No special parameters
-
Request parameters
No special parameters
Response
| Name | Description |
|---|---|
| status | Enabling status of bucket access logging function, with the values enabled and disabled.enabled indicates that the function is enabled, while disabled indicates that the function is disabled. |
| targetBucket | Specifies the bucket designated for storing access logs. This field is omitted in responses when logging is disabled. |
| targetPrefix | Specifies the prefix used for naming access log files. This field is omitted in responses when logging is disabled. |
Notes
- If the source bucket specified in the request does not exist, a 404 error will be returned with the code "NoSuchBucket.\
- Only the requester who owns the source bucket with FULL_CONTROL permission can view it. Otherwise, a 403 error with the code AccessDenied will be returned.
Example
-
Request example
Plain Text1Get /?logging HTTP/1.1 2Host: BucketName.bj.bcebos.com 3Date: Tue, 17 May 2016 08:36:52 GMT 4Authorization: AuthorizationString 5Content-Length: 0 -
Response example (log rule is set)
Plain Text1HTTP/1.1 200 OK 2x-bce-request-id: 1a5fd81e-626b-45b3-a885-15fff9cd106c 3Date: Tue, 17 May 2016 08:36:52 GMT 4Content-Length: 71 5Server: BceBos 6{ 7 "status": "enabled", 8 "targetBucket": "dscbucket", 9 "targetPrefix": "mylog-" 10} -
Response example (log rule is not set)
Plain Text1HTTP/1.1 200 OK 2x-bce-request-id: 1a5fd81e-626b-45b3-a885-15fff9cd106c 3Date: Tue, 17 May 2016 08:36:52 GMT 4Content-Length: 21 5Server: BceBos 6{ 7 "status": "disabled" 8}
