S3 Put Bucket Logging
    • Dark
      Light

    S3 Put Bucket Logging

    • Dark
      Light

    Article summary

    PUThttps://s3.<your-region>.backblazeb2.com/<your-bucket-name>/?logging

    Configure Bucket Access Logs for a bucket. 

    Please contact Backblaze Sales to enable Bucket Access Logs for your account. Even though the Access Logs configuration option on your Buckets is displayed in the Backblaze web console, Bucket Access Logs still need to be enabled by a Backblaze sales representative. 

    Set the logging parameters for a bucket. To set the logging status of a bucket, you must be the bucket owner.

    The following are requirements for assigning a destination bucket to receive Bucket Access Logs:

    • Destination bucket must be a B2 Cloud Storage bucket

    • Destination bucket and source bucket must be in the same account

    AUTHORIZATION AWS Signature

    This request is using AWS Signature from collection Backblaze B2 Cloud Storage S3 Compatible API.

    URI REQUEST PARAMETERS

    bucket

    Required. The name of the bucket for which to set the logging parameters.

    Content-MD5
    MD5 hash of the request body.
    x-amz-expected-bucket-owner
    The account ID of the expected bucket owner.
    x-amz-sdk-checksum-algorithm

    The algorithm used to create the checksum for the request when you use the SDK. 

    Note: when you send this header, there must be a corresponding x-amz-checksum or x-amz-trailer header sent. 

    REQUEST BODY

    BucketLoggingStatusRequired. Root level tag for the BucketLoggingStatus parameters.
    LoggingEnabledDescribes where logs are stored and the prefix that Backblaze assigns to all log object keys for a bucket.

    Example Request

    curl --location --request PUT 'https://s3.<your-region>.backblazeb2.com/my-bucket-name/?logging' \
    --data '<BucketLoggingStatus xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
       <LoggingEnabled>
          <TargetBucket>target-bucket</TargetBucket>
          <TargetPrefix>prefix/</TargetPrefix>
       </LoggingEnabled>
    </BucketLoggingStatus>'

    Example Response

    200 OK


    HTTP/1.1 200 OK
    x-amz-id-2: YgIPIfBiKa2bj0KMg95r/0zo3emzU4dzsD4rcKCHQUAdQkf3ShJTOOpXUueF6QKo
    x-amz-request-id: 236A8905248E5A01
    Date: Wed, 01 Mar  2025 12:00:00 GMT



    Was this article helpful?