Updated on 2023-09-26 GMT+08:00

Log Reporting

Scenarios

If you enable log reporting for your DB instance, new logs generated for the instance will be uploaded to Log Tank Service (LTS) for management.

Precautions

  • To use this function, contact customer service to apply for required permissions.
  • You will be billed for enabling this function under LTS.
  • Ensure that there are available LTS log groups and log streams in the same region as your instance.

    For more information about log groups and log streams, see Log Management.

Constraints

  • Error logs and slow query logs cannot share the same log stream.
  • If a structuring template (PostgreSQL slow log template or PostgreSQL error log template) has been bound to a log stream, ensure that the template type is the same as the log type when you select the log stream. For example, if a PostgreSQL error log template has been bound to a log stream, the log stream cannot be used for slow query logs.

    For details about how to bind a system template to a log stream, see Log Structuring.

Enabling Log Reporting in Batches

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and a project.
  3. Click in the upper left corner of the page and choose Databases > Relational Database Service.
  4. In the navigation pane, click Log Reporting. On the displayed page, select PostgreSQL from the drop-down list.

    Figure 1 Log reporting

  5. Select one or more instances and click Enable Log Reporting.
  6. Select an LTS log group and log stream and click OK.

    • Error logs and slow query logs cannot share the same log stream.
    • This request does not take effect immediately. There is a delay of about 10 minutes.
    Figure 2 Enabling log reporting

  7. To disable log reporting, select one or more instances and click Disable Log Reporting.
  8. In the displayed dialog box, click OK.

    Figure 3 Disabling log reporting