Querying Database Error Logs
Function
This API is used to query the latest 2000 database error logs.
- Before calling an API, you need to understand the API in Authentication.
- Before calling this API, obtain the required region and endpoint.
URI
- URI format
GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/errorlog?start_date={start_date}&end_date={end_date}
- Example
https://rds.cn-north-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/cee5265e1e5845649e354841234567dfin01/errorlog?offset=1&limit=10&start_date=2018-08-06T10:41:14+0800&end_date=2018-08-07T10:41:14+0800&level=ALL
- Parameter description
Table 1 Parameter description Name
Mandatory
Description
project_id
Yes
Specifies the 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
Specifies the ID of the queried DB instance.
start_date
Yes
Specifies the 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
Specifies the 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
Specifies the page offset, such as 1, 2, 3, or 4. The parameter value is 1 by default if it is not specified.
limit
No
Specifies the number of records on each page. Its value range is from 1 to 100. The parameter value is 10 by default if it is not specified.
level
No
Specifies the log level. The default value is ALL. Valid value:
- ALL
- INFO
- LOG
- WARNING
- ERROR
- FATAL
- PANIC
- NOTE
Request
None
Response
- Normal response
Table 2 Parameter description Name
Type
Description
error_log_list
Array of objects
Indicates detailed information.
For details, see Table 3.
total_record
Integer
Indicates the total number of records.
- Example normal response
{ "error_log_list": [{ "time": "2018-12-04T14:24:42", "level": "ERROR", "content": "Slave I/O for channel '': error connecting to master 'rdsRepl@172.16.30.111:3306' - retry-time: 60 retries: 1, Error_code: 203" }, { "time": "2018-12-04T14:24:42", "level": "ERROR", "content": "Slave I/O for channel '': error connecting to master 'rdsRepl@172.11.11.111:8081' - retry-time: 60 retries: 1, Error_code: 203" }], "total_record": 2 } - Abnormal Response
For details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
Last Article: Log Information Queries
Next Article: Querying Database Slow Logs
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.