getBucketLogging method
Written by
Updated at January 17, 2023
Returns settings for logging actions with the bucket.
Request
GET /{bucket}?logging HTTP/2
Path parameters
Parameter | Description |
---|---|
bucket |
Bucket name. |
Query parameters
Parameter | Description |
---|---|
logging |
Required parameter that indicates the type of operation. |
Headers
Use common request headers in requests.
Response
Headers
Responses can only contain common response headers.
Response codes
For a list of possible responses, see Responses.
A successful response contains additional data in XML format with the schema described below.
Data schema
Response if logging of actions with the bucket is not configured:
<?xml version="1.0" encoding="UTF-8"?>
<BucketLoggingStatus xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<!--<LoggingEnabled><TargetBucket>bucket-logs</TargetBucket><TargetPrefix>add/this/prefix/to/my/log/files/access_log-</TargetPrefix></LoggingEnabled>-->
</BucketLoggingStatus>
Response if logging of actions with the bucket is configured:
<?xml version="1.0" encoding="UTF-8"?>
<BucketLoggingStatus xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<LoggingEnabled>
<TargetBucket>bucket-logs</TargetBucket>
<TargetPrefix>logs/</TargetPrefix>
</LoggingEnabled>
</BucketLoggingStatus>
Element | Description |
---|---|
BucketLoggingStatus |
Root element. |
TargetBucket |
Name of the target bucket where the log objects are saved. Path: /BucketLoggingStatus/LoggingEnabled/TargetBucket .Type: String |
TargetPrefix |
Prefix of the key for the log object. Path: /BucketLoggingStatus/LoggingEnabled/TargetPrefix .Type: String |