Torch Object Storage
This interface is used to enable or disable the log storage feature.
Currently, only Beijing and Shanghai support the log storage feature.
PUT /?logging HTTP/1.1 Host: bucketname.tos-cn-beijing.volces.com Authorization: authorization string Date: Fri, 30 Jul 2021 06:45:39 GMT { "LoggingEnabled": { "TargetBucket": "test", "TargetPrefix": "prefix", "Role": "ServiceRoleforTOSLogging" } }
This request uses the common request message headers; see Common parameters.
| Name | Location | Type | Required | Sample Value | Description |
|---|---|---|---|---|---|
| logging | Query | String | Yes | - | A special identifier representing the PutBucketLogging request. |
tip
If the PutBucketLogging interface is called to disable log storage, configure the request element as
{}.
| Name | Type | Required | Sample Value | Description |
|---|---|---|---|---|
| LoggingEnabled | Container | No | - | Configuration rules for enabling the log storage feature. |
| TargetBucket | String | No | test | The target storage bucket for storing log files. |
TargetPrefix | String | No | tos-accesslog | The log files' storage path in the target bucket. |
| Role | String | No | ServiceRoleforTOSLogging | The role name used to grant the object storage permission to read all files from the source bucket and write files to the target bucket. This role must have TOS read-write and service access permissions. You can also use the TOS default role ServiceRoleforTOSLogging. |
This request returns public response message headers. See Common parameters.
There is no message element in this request response.
Call the PutBucketLogging API to enable log storage.
PUT /?logging HTTP/1.1 Host: bucketname.tos-cn-beijing.volces.com Authorization: authorization string Date: Fri, 30 Jul 2021 06:45:39 GMT { "LoggingEnabled": { "TargetBucket": "test", "TargetPrefix": "prefix", "Role": "ServiceRoleforTOSLogging" } }
HTTP/1.1 200 OK x-tos-id-2: 4fac130beeb50032-a444ed0 x-tos-request-id: 4fac130beeb50032-a444ed0 Date: Mon, 12 May 2025 07:02:38 GMT server: TosServer Content-Length: 0
Call the PutBucketLogging interface to disable log storage
PUT /?logging HTTP/1.1 Host: bucketname.tos-cn-beijing.volces.com Authorization: authorization string Date: Fri, 30 Jul 2021 06:45:39 GMT {}
HTTP/1.1 200 OK x-tos-id-2: 4fac130beeb50032-a444ed0 x-tos-request-id: 4fac130beeb50032-a444ed0 Date: Mon, 12 May 2025 06:54:12 GMT server: TosServer Content-Length: 0