Updated on 2023-10-18 GMT+08:00

Querying Database Error Logs

Function

This API is used to query database error logs. Before calling this API:

URI

  • URI format

    GET https://{endpoint}/mysql/v3/{project_id}/instances/{instance_id}/errorlog?offset={offset}&limit={limit}&level={level}&start_date={start_date}&end_date={end_date}&node_id={node_id}

  • Example

    GET https://{endpoint}/mysql/v3/97b026aa9cc4417888c14c84a1ad9860/instances/c3ec2c6148ad4d71b1a8411a62df0d3cin07/errorlog?offset=0&limit=100&level=ALL&start_date=2018-08-06T10:41:14+0800&end_date=2018-08-07T10:41:14+0800&node_id=cc07c60e94ec4575989840e648fb4f66no07

  • Parameter description
    Table 1 Parameter description

    Name

    Type

    Mandatory

    Description

    project_id

    String

    Yes

    Project ID of a tenant in a region.

    To obtain this value, see Obtaining a Project ID.

    instance_id

    String

    Yes

    DB instance ID.

    node_id

    String

    Yes

    Instance node ID.

    start_date

    String

    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.

    end_date

    String

    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.

    Only error logs generated within the last month can be queried.

    offset

    Integer

    No

    Index offset. If offset is set to N, the resource query starts from the N+1 piece of data. The default value is 0, indicating that the query starts from the first piece of data. The value must be a positive integer and the minimum value is 0.

    limit

    Integer

    No

    Number of records to be queried. The default value is 10. The value must be a positive integer. The minimum value is 1 and the maximum value is 100.

    level

    String

    No

    Log level. The default value is ALL. Valid value:

    • ALL
    • INFO
    • WARNING
    • ERROR
    • FATAL
    • NOTE

Request

None.

Response

  • Normal response
    Table 2 Parameter description

    Name

    Type

    Description

    error_log_list

    Array of objects

    Error log details.

    For details, see Table 3.

    total_record

    Integer

    Total number of records.

    Table 3 error_log_list parameter description

    Name

    Type

    Description

    node_id

    String

    Node ID.

    time

    String

    Time in the UTC format.

    level

    String

    Log level.

    • ALL
    • INFO
    • WARNING
    • ERROR
    • FATAL
    • NOTE

    content

    String

    Error log content.

  • Example normal response

    {

    "error_log_list":[

    {

    "node_id":"cc07c60e94ec4575989840e648fb4f66no07",

    "time":" 2021-03-06T12:07:05",

    "level":"ERROR",

    "content":"[MY013508] [Repl] do failed: 1"

    }

    ],

    "total_record":15

    }

Status Code

For details, see Status Codes.

Error Code

For details, see Error Codes.