Enables or disables the log retrieval feature for a specified domain name.

Note The log retrieval feature is upgraded to the Log Service for WAF feature. For more information, see Log Service for WAF. This API is available only to users who use the log retrieval feature. If you want to enable or disable the Log Service for WAF feature, call the ModifyLogServiceStatus operation.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ModifyLogRetrievalStatus

The operation that you want to perform. Set the value to ModifyLogRetrievalStatus.

Domain String Yes www.example.com

The domain name that you add to WAF.

Note You can call the DescribeDomainNames operation to query all domain names that you add to WAF.
Enabled Integer Yes 1

Specifies whether to enable the log retrieval feature. Valid values:

  • 0: enabled
  • 1: disabled
Note To log access requests that are sent to a domain name, you must enable the log retrieval feature for the domain name. If you disable the log retrieval feature for a domain name, WAF does not log access requests that are sent to the domain name. After you enable the feature again, you cannot query the access requests that were sent over the time period when the feature is disabled.
InstanceId String Yes waf_elasticity-cn-0xldbqt****

The ID of the WAF instance.

Note You can call the DescribeInstanceInfo operation to query the ID of the WAF instance.

All Alibaba Cloud API operations must include common request parameters. For more information about common request parameters, see Common parameters.

For more information about sample requests, see the "Examples" section of this topic.

Response parameters

Parameter Type Example Description
RequestId String D7861F61-5B61-46CE-A47C-6B19160D5EB0

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/? Action=ModifyLogRetrievalStatus
&Domain=www.example.com
&Enabled=1
&InstanceId=waf_elasticity-cn-0xldbqt****
&<Common request parameters>

Sample success responses

XML format

<ModifyLogRetrievalStatusResponse>
      <RequestId>D7861F61-5B61-46CE-A47C-6B19160D5EB0</RequestId>
</ModifyLogRetrievalStatusResponse>

JSON format

{
    "RequestId": "D7861F61-5B61-46CE-A47C-6B19160D5EB0"
}

Error codes

For a list of error codes, visit the API Error Center.