Querying Error Logs Through LTS
Function
This API is used to query error logs of a DB instance when Log Tank Service (LTS) is available in the current region.
- Before calling this API, learn how to authenticate it.
- Before calling this API, learn about request header parameters.
URI
- Parameter description
Table 1 Parameters Parameter
Mandatory
Description
project_id
Yes
Project ID of a tenant in a region.
To obtain the value, see Obtaining a Project ID.
instance_id
Yes
ID of the instance to be queried.
Request
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
start_time |
Yes |
String |
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. The start time cannot be more than one month earlier than the current time. |
end_time |
Yes |
String |
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. Only error logs generated in the past month can be queried. |
level |
No |
String |
Log level. The default value is ALL. Enumerated values:
|
line_num |
No |
String |
Sequence number of a log event. This parameter is not required for the first query, but is required for subsequent pagination queries. The value can be obtained from the response of the last query. The value of line_num should be between the values of start_time and end_time. |
search_type |
No |
String |
Search mode. The default value is forwards. This parameter is used together with line_num. The search starts from line_num and is performed forwards or backwards. |
limit |
No |
Integer |
Number of records (query results) displayed on each page. The number ranges from 1 to 100. The default value is 10. |
Example Request
POST https://{endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/instances/cee5265e1e5845649e354841234567dfin01/error-logs { "start_time":"2023-01-05T08:00:00+0800", "end_time":"2023-01-11T20:00:00+0800", "limit":10, "line_num":"1672908793000000000", "search_type":"forwards" }
Response
- Normal response
Table 3 Parameters Parameter
Type
Description
error_log_list
Array of objects
Error logs.
For details, see Table 4.
- 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.", "line_num" : "1595659490239433658" } ] }
- 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