Menu
Amazon Simple Storage Service
API Reference (API Version 2006-03-01)

GET Bucket logging

Note

Logging functionality is currently in beta.

Description

This implementation of the GET operation uses the logging subresource to return the logging status of a bucket and the permissions users have to view and modify that status. To use GET, you must be the bucket owner.

Requests

Syntax

GET /?logging HTTP/1.1
Host: BucketName.s3.amazonaws.com
Date: date
Authorization: authorization string

Request Parameters

This implementation of the operation does not use request parameters.

Request Headers

This implementation of the operation uses only request headers that are common to all operations. For more information, see Common Request Headers.

Request Elements

This implementation of the operation does not use request elements.

Responses

Response Headers

This implementation of the operation uses only response headers that are common to most responses. For more information, see Common Response Headers.

Response Elements

Name Description
BucketLoggingStatus

Container for the response.

Type: Container

Ancestry: None

EmailAddress

E-mail address of the person whose logging permissions are displayed.

Type: String

Ancestry: BucketLoggingStatus.LoggingEnabled.TargetGrants.Grant.Grantee

Grant

Container for Grantee and Permission.

Type: Container

Ancestry: BucketLoggingStatus.LoggingEnabled.TargetGrants

Grantee

Container for EmailAddress of the person whose logging permissions are displayed.

Type: Container

Ancestry: BucketLoggingStatus.LoggingEnabled.TargetGrants.Grant

LoggingEnabled

Container for logging information. This element and its children are present when logging is enabled, otherwise, this element and its children are absent.

Type: Container

Ancestry: BucketLoggingStatus

Permission

Logging permissions assigned to the Grantee for the bucket.

Type: String

Valid Values: FULL_CONTROL | READ | WRITE

Ancestry: BucketLoggingStatus.LoggingEnabled.TargetGrants.Grant

TargetBucket

Specifies the bucket whose logging status is being returned. This element specifies the bucket where server access logs will be delivered.

Type: String

Ancestry: BucketLoggingStatus.LoggingEnabled

TargetGrants

Container for granting information.

Type: Container

Ancestry: BucketLoggingStatus.LoggingEnabled

TargetPrefix

Specifies the prefix for the keys that the log files are being stored under.

Type: String

Ancestry: BucketLoggingStatus.LoggingEnabled

Special Errors

This implementation of the operation does not return special errors. For general information about Amazon S3 errors and a list of error codes, see Error Responses.

Examples

Sample Request

The following request returns the logging status for mybucket.

GET ?logging HTTP/1.1
Host: mybucket.s3.amazonaws.com
Date: Wed, 25 Nov 2009 12:00:00 GMT
Authorization: authorization string

Sample Response Showing an Enabled Logging Status

HTTP/1.1 200 OK
Date: Wed, 25 Nov 2009 12:00:00 GMT
Connection: close
Server: AmazonS3

<?xml version="1.0" encoding="UTF-8"?>
<BucketLoggingStatus xmlns="http://doc.s3.amazonaws.com/2006-03-01">
  <LoggingEnabled>
    <TargetBucket>mybucketlogs</TargetBucket>
    <TargetPrefix>mybucket-access_log-/</TargetPrefix>
    <TargetGrants>
      <Grant>
        <Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:type="AmazonCustomerByEmail">
          <EmailAddress>user@company.com</EmailAddress>
        </Grantee>
        <Permission>READ</Permission>
      </Grant>
    </TargetGrants>
  </LoggingEnabled>
</BucketLoggingStatus>

Sample Response Showing a Disabled Logging Status

HTTP/1.1 200 OK
Date: Wed, 25 Nov 2009 12:00:00 GMT
Connection: close
Server: AmazonS3

<?xml version="1.0" encoding="UTF-8"?>
<BucketLoggingStatus xmlns="http://doc.s3.amazonaws.com/2006-03-01" />