Querying Database Error Logs (MySQL)
Function
This API is used to query the latest error logs of a DB instance. A maximum of 2,000 log records can be queried.
- Before calling an API, you need to understand the API in Authentication.
Constraints
This API is supported for MySQL only.
URI
- URI format
GET /v3.1/{project_id}/instances/{instance_id}/errorlog?start_date={start_date}&end_date={end_date}
- Parameter description
Table 1 Parameter description Name
Mandatory
Description
project_id
Yes
Project ID of a tenant in a region.
For details about how to obtain the project ID, see Obtaining a Project ID.
instance_id
Yes
ID of the instance to be queried.
start_date
Yes
Start time in the "yyyy-mm-ddThh:mm:ssZ" format.
T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, in the Beijing time zone, the time zone offset is shown as +0800.
end_date
Yes
End time in the "yyyy-mm-ddThh:mm:ssZ" format.
T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, in the Beijing time zone, the time zone offset is shown as +0800.
You can only query error logs generated within a month.
offset
No
Index offset.
If offset is set to N, the resource query starts from the N+1 piece of data. The value is 0 by default, indicating that the query starts from the first piece of data. The value cannot be a negative number.
limit
No
Number of records (query results) displayed on each page. The number ranges from 1 to 100. The default value is 10.
level
No
Log level. The default value is ALL. Valid value:
- ALL
- INFO
- LOG
- WARNING
- ERROR
- FATAL
- PANIC
- NOTE
Request
Response
- Normal response
Table 2 Parameter description Name
Type
Description
error_log_list
Array of objects
Detailed information.
For details, see Table 3.
total_record
Integer
Total number of records.
- Example normal response
{ "error_log_list": [ { "time": "2022-08-23T22:59:17Z", "level": "WARNING", "content": "Occur error when reading bytes from a network handler. Client actively closes the connection." }, { "time": "2022-08-23T22:54:17Z", "level": "WARNING", "content": "Occur error when reading bytes from a network handler. Client actively closes the connection." } ], "total_record": 2 }
- Abnormal response
For details, see Abnormal Request Results.
Status Code
- Normal
- Abnormal
For details, see Status Codes.
Error Code
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot