tencent cloud

TencentDB for MySQL

Log Delivery

Download
Focus Mode
Font Size
Last updated: 2026-06-10 11:42:00
TencentDB for MySQL provides the log shipping feature. Using this feature, you can collect slow log and error log data from TencentDB for MySQL instances and ship the logs to CLS for analysis, enabling you to quickly monitor and locate business issues. This document describes how to enable or disable the log shipping feature via the console.

Prerequisites

Before using this feature, ensure that you have activated CLS.

Use Limits

Only Cluster Edition instances, two-node/three-node local disk instances, and read-only instances support the log shipping feature.

Definition of Slow Logs

Field Value
Type
Description
TIMESTAMP
-
A reserved field of CLS, indicating the log generation time.
instance_id
String
Database instance ID, for example, cdb-xxx.
db_name
String
Database name.
rows_examined
Long
Number of rows scanned.
rows_sent
Long
Number of rows returned.
query_time
Double
Execution time (unit: s).
lock_time
Double
Lock wait time (unit: s).
user_host
String
Client information.
user_name
String
Username used by the client to connect to the database instance.
query_sql
String
Slow log SQL.

Definition of Error Logs

Field Value
Type
Description
TIMESTAMP
-
A reserved field of CLS, indicating the log generation time.
instance_id
String
Database instance ID, for example, cdb-xxx.
content
String
Error log content.
level
String
Error log level.
For example, warning, note, error, etc.
Logs without a level are none, for example, deadlock error logs.

Enabling Slow Log Shipping

1. Log in to the TencentDB for MySQL console. On the instance list page, click the Instance ID to go to the management page.
2. On the instance management page, choose Log Center > Log Delivery.
3. Under Slow Log Delivery, click the edit icon.

4. In the pop-up window, select Enable, complete the following configurations, and click OK.

Parameter
Description
Region
Select the region for log shipping. Cross-region shipping is supported.
Logset Management
A logset categorizes log topics to facilitate your management of log topics. You can select an existing logset or create a logset.
Logset
Select an existing logset: You can filter existing logsets in the search box to categorize slow log shipping.
Create a logset: You can create a new logset to categorize slow log shipping. The naming format for the logset is cloud_custom_logset, where the custom part can only contain English letters, digits, and underscores, and its length cannot exceed 20 characters.
Log Topic Management
A log topic is the basic unit for log data collection, storage, retrieval, and analysis. You can select an existing log topic or create a log topic.
Log Topic
Select an existing log topic: This option is available only when an existing logset is selected. You can filter log topics under the selected logset in the search box.
Create a log topic: Create a new log topic under the selected logset. The naming format for the log topic is cloud_custom_topic, where the custom part can only contain English letters, digits, and underscores, and its length cannot exceed 20 characters.
Note:
You can manage log topics. For details, see Managing Log Topics.
Retention Period
Select the retention period for slow log shipping data. The default value is 30 days. You can select a period from 1 day to 3600 days. Data will be automatically cleared after the logs expire. If an existing log topic is selected, the retention period will be consistent with the retention period of the corresponding existing log topic by default.
Index Creation
Enabled by default. Index configuration is a prerequisite for using CLS for search and analysis. Logs can be searched and analyzed only after the index is enabled. Learn more
If an existing log topic is selected, the index status will be consistent with the index status of the corresponding existing log topic by default.
5. After slow log shipping is successfully enabled, you can see that slow log shipping is enabled under Log Shipping. Click the log topic name to jump to the CLS console for subsequent analysis and management.


Disabling Slow Log Shipping

Note:
After slow log shipping is disabled, the generated slow log shipping data will be saved at the saving time selected when slow log shipping is enabled, and will be automatically cleared only after expiration.
1. Log in to the TencentDB for MySQL console. On the instance list page, click the Instance ID to go to the management page.
2. On the instance management page, choose Log Center > Log Delivery.
3. Under Slow Log Delivery, click the edit icon.
4. In the pop-up window, select Close and click OK.

Enabling Error Log Shipping

1. Log in to the TencentDB for MySQL console. On the instance list page, click the Instance ID to go to the management page.
2. On the instance management page, choose Log Center > Log Delivery.
3. Under Error Log Delivery, click the edit icon.
4. In the pop-up window, select Enable, complete the following configurations, and click OK.

Parameter
Description
Region
Select the region for log shipping. Cross-region shipping is supported.
Logset Management
A logset categorizes log topics to facilitate your management of log topics. You can select an existing logset or create a logset.
Logset
Select an existing logset: You can filter existing logsets in the search box to categorize error log shipping.
Create a logset: You can create a new logset to categorize error log shipping. The naming format for the logset is cloud_custom_logset, where the custom part can only contain English letters, digits, and underscores, and its length cannot exceed 20 characters.
Log Topic Management
A log topic is the basic unit for log data collection, storage, retrieval, and analysis. You can select an existing log topic or create a log topic.
Log Topic
Select an existing log topic: This option is available only when an existing logset is selected. You can filter log topics under the selected logset in the search box.
Create a log topic: Create a new log topic under the selected logset. The naming format for the log topic is cloud_custom_topic, where the custom part can only contain English letters, digits, and underscores, and its length cannot exceed 20 characters.
Note:
You can manage log topics. For details, see Managing Log Topics.
Retention Period
Select the retention period for slow log shipping data. The default value is 30 days. You can select a period from 1 day to 3600 days. Data will be automatically cleared after the logs expire. If an existing log topic is selected, the retention period will be consistent with the retention period of the corresponding existing log topic by default.
Index Creation
Enabled by default. Index configuration is a prerequisite for using CLS for search and analysis. Logs can be searched and analyzed only after the index is enabled. Learn more
If an existing log topic is selected, the index status will be consistent with the index status of the corresponding existing log topic by default.
5. After slow log shipping is successfully enabled, you can see that slow log shipping is enabled under Log Shipping. Click the log topic name to jump to the CLS console for subsequent analysis and management.


Disabling Error Log Shipping

Note:
After error log shipping is disabled, the generated error log shipping data will be saved at the saving time selected when error log shipping is enabled, and will be automatically cleared only after expiration.
1. Log in to the TencentDB for MySQL console. On the instance list page, click the Instance ID to go to the management page.
2. On the instance management page, choose Log Center > Log Delivery.
3. Under Error Log Delivery, click the edit icon.
4. In the pop-up window, select Close and click OK.

References

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback