Skip to main content

GetBucketLogging

Returns the logging status of a bucket and the permissions users have to view and modify that status.

Description

The GetBucketLogging operation returns the logging status of a bucket and the permissions users have to view and modify that status. To use this operation, you must be the bucket owner or have the appropriate permissions.

Server access logging provides detailed records for the requests that are made to a bucket. The logs contain information such as:

  • The request type
  • The resources that are requested
  • The time and date of the request
  • The requester
  • The response status
note
  • To use this operation, you must have permission to perform the s3:GetBucketLogging action.
  • You must be the bucket owner to use this operation.
  • If logging is not enabled on the bucket, the response will include an empty BucketLoggingStatus element.
  • This operation is not supported for directory buckets.

Request Syntax

GET /?logging HTTP/1.1
Host: BucketName.qstorage.quilibrium.com
x-amz-expected-bucket-owner: OwnerAccountId
Values in italics indicate user input and should be replaced with actual values.

This operation does not have a request body.

Request Parameters

Headers

NameDescriptionRequiredType
x-amz-expected-bucket-ownerThe account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).Notext

Examples

Example 1: Get bucket logging configuration when logging is enabled

GET /?logging HTTP/1.1
Host: my-bucket.qstorage.quilibrium.com
Values in italics indicate user input and should be replaced with actual values.
HTTP/1.1 200 OK
x-amz-id-2: Example7qoYGN7uMuFuYS6m7a4l
x-amz-request-id: TX234S0F24A06C7
Date: Wed, 01 Mar 2024 12:00:00 GMT
<?xml version="1.0" encoding="UTF-8"?> <BucketLoggingStatus xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <LoggingEnabled> <TargetBucket>my-logging-bucket</TargetBucket> <TargetPrefix>logs/</TargetPrefix> <TargetGrants> <Grant> <Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="AmazonCustomerByEmail"> <EmailAddress>user@example.com</EmailAddress> </Grantee> <Permission>READ</Permission> </Grant> </TargetGrants> </LoggingEnabled> </BucketLoggingStatus>
Values in italics indicate variable response values.

Example 2: Get bucket logging configuration when logging is disabled

GET /?logging HTTP/1.1
Host: my-bucket.qstorage.quilibrium.com
Values in italics indicate user input and should be replaced with actual values.
HTTP/1.1 200 OK
x-amz-id-2: Example7qoYGN7uMuFuYS6m7a4l
x-amz-request-id: TX234S0F24A06C7
Date: Wed, 01 Mar 2024 12:00:00 GMT
<?xml version="1.0" encoding="UTF-8"?> <BucketLoggingStatus xmlns="http://s3.amazonaws.com/doc/2006-03-01/"/>
Values in italics indicate variable response values.

Response Syntax

HTTP/1.1 200 OK
x-amz-id-2: RequestId
x-amz-request-id: AmazonRequestId
Date: ISO8601Date
<?xml version="1.0" encoding="UTF-8"?> <BucketLoggingStatus xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <LoggingEnabled> <TargetBucket>TargetBucket</TargetBucket> <TargetPrefix>TargetPrefix</TargetPrefix> <TargetGrants> <Grant> <Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="GranteeType"> <ID>GranteeID</ID> <DisplayName>GranteeName</DisplayName> <EmailAddress>GranteeEmail</EmailAddress> <URI>GranteeURI</URI> </Grantee> <Permission>Permission</Permission> </Grant> </TargetGrants> </LoggingEnabled> </BucketLoggingStatus>
Values in italics indicate variable response values.

Response Elements

Response Headers

NameDescriptionRequiredType
x-amz-id-2An identifier for the requestNoString
x-amz-request-idA unique identifier for the requestNoString
DateThe date and time at which the response was sentNoString

Response Body Elements

NameDescriptionRequiredType
BucketLoggingStatusRoot level tag for the BucketLoggingStatus parameters. See BucketLoggingStatus for details.NoString
LoggingEnabledContainer for logging information. See LoggingEnabled for details.NoString

Special Errors

Error CodeDescription
NoSuchBucketThe specified bucket does not exist
403Forbidden. Authentication failed or you do not have permission to get the bucket logging configuration

Permissions

You must have the s3:GetBucketLogging permission.

Try It Out

Test GetBucketLogging

Get the logging configuration of a bucket.

Coming Soon

This feature is currently under development and will be available soon.