PUT /?logging HTTP 1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate:dateContent-Length: lengthContent-Type: application/xmlContent-MD5: MD5Authorization: Auth String
<BucketLoggingStatus><LoggingEnabled><TargetBucket>examplebucket-1250000000</TargetBucket><TargetPrefix>prefix</TargetPrefix></LoggingEnabled></BucketLoggingStatus>
节点名称(关键字) | 父节点 | 描述 | 类型 | 是否必选 |
BucketLoggingStatus | 无 | 说明日志记录配置的状态,如果无子节点信息则意为关闭日志记录 | Container | 是 |
节点名称(关键字) | 父节点 | 描述 | 类型 | 是否必选 |
LoggingEnabled | BucketLoggingStatus | 存储桶 logging 设置的具体信息,主要是目标存储桶 | Container | 否 |
节点名称(关键字) | 父节点 | 描述 | 类型 | 是否必选 |
TargetBucket | LoggingEnabled | 存放日志的目标存储桶,可以是同一个存储桶(但不推荐),或同一账户下、同一地域的存储桶 | String | 否 |
TargetPrefix | LoggingEnabled | 日志存放在目标存储桶的指定路径 | String | 否 |
目标存储桶/路径前缀{YYYY}/{MM}/{DD}/{time}_{random}_{index}.gz
。PUT /?logging HTTP 1.1Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.comDate: Fri, 10 Mar 2017 09:45:46 GMTAuthorization: q-sign-algorithm=sha1&q-ak=AKIDWtTCBYjM5OwLB9CAwA1Qb2ThTSUj****&q-sign-time=1484814927;32557710927&q-key-time=1484814927;32557710927&q-header-list=host&q-url-param-list=accelerate&q-signature=8b9f05dabce2578f3a79d732386e7cbade90****Content-Type: application/xmlContent-Length: 147<BucketLoggingStatus><LoggingEnabled><TargetBucket>examplebucket-1250000000</TargetBucket><TargetPrefix>prefix</TargetPrefix></LoggingEnabled></BucketLoggingStatus>
HTTP/1.1 200 OKContent-Type: application/xmlContent-Length: 0Connection: keep-aliveDate: Fri, 10 Mar 2017 09:45:46 GMTServer: tencent-cosx-cos-request-id: NTg4MDdiZWRfOWExZjRlXzQ2OWVf****
本页内容是否解决了您的问题?