All Documents
Current Document

Content is empty

If you don't find the content you expect, please try another search term

Documentation

GET Bucket logging

Last updated:2021-09-14 16:18:03

Description

This GET operation uses the 'logging' resource to return the logging status of the user space.

If you use this interface, you need to be the owner of this space.

Request

Grammar

GET /?logging HTTP/1.1
Host: {BucketName}.{endpoint}
Date: {date}
Authorization: {SignatureValue}

Note:

Request parameters

The interface does not use request parameters.

Request header

This interface only uses common request headers. For more information, please click Public request headers.

Request content

The interface does not use the requested content.

Response

Response header

This interface can use all common response headers. For more information, please click Public response headers.

Response content

Name Description
BucketLoggingStatus Container for response information.
Type: Container
Parent node: None
LoggingEnabled Container for log information. When logging is enabled, the container and its child nodes appear, otherwise, they disappear.
Type: Container
Parent node: BucketLoggingStatus
TargetBucket Specifies the user space where log information needs to be returned.
Type: String
Parent node: BucketLoggingStatus.LoggingEnabled
TargetGrants Container for authorization information. (this function is not supported temporarily)
Type: Container
Parent node: BucketLoggingStatus.LoggingEnabled
TargetPrefix Specifies the prefix of the key value (logical hierarchy + filename) where the log file is stored.
Type: String
Parent node: BucketLoggingStatus.LoggingEnabled

Special errors

The interface does not return any special errors.

Example

Request example

    GET /?logging HTTP/1.1
    Host: ks3-example.ks3-cn-beijing.ksyuncs.com
    Date: Wed, 25 Nov 2009 12:00:00 GMT
    Authorization: authorization string

Example of enabling log response

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

    <?xml version="1.0" encoding="UTF-8"?>
    <BucketLoggingStatus xmlns="http://doc.s3.amazonaws.com/2006-03-01">
      <LoggingEnabled>
        <TargetBucket>ks3-example</TargetBucket>
        <TargetPrefix>mybucket-access_log-/</TargetPrefix>
        <TargetGrants>
        </TargetGrants>
      </LoggingEnabled>
    </BucketLoggingStatus>

Example of not enabling log response

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

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

Pure Mode

Click to preview the document content in full screen
Feedback