PutBucketLogging

Enables and disables the mechanism for logging actions with the bucket.

Request

PUT /{bucket}?logging HTTP/1.1

Path parameters

ParameterDescription

bucket

Name of the bucket.

Query parameters

ParameterDescription

logging

Required parameter that indicates the type of operation.

Data schema

To enable logging of actions with the bucket:

<?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>
ElementDescription

BucketLoggingStatus

Root element.

TargetBucket

The name of the target bucket where the objects are saved with logs. Type: String.

TargetPrefix

Object key prefix with logs. Type: String.

To disable logging of actions with the bucket:

<BucketLoggingStatus xmlns="http://doc.s3.amazonaws.com/2006-03-01" />

Headers

Use only 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 does not contain any additional data.

Last updated