GET Bucket logging

最近更新时间:2020-04-03 03:02:28

GET Bucket logging


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.ksyun.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" />

金山云,开启您的云计算之旅

注册有礼