Collecting Logs from GaussDB(for MySQL)
LTS can collect logs from GaussDB(for MySQL). For details, see Enabling or Disabling Log Reporting.
Structuring Template Details of GAUSSDB_MYSQL Slow Query Logs
- GAUSSDB_MYSQL slow query log example
Table 1 Structuring template example Template Name
Example Log
GaussDB_MySQL slow query logs
{"start_time":"2022-07-27T02:49:19.000","user":"commerce","host":"100.*.*.222","query_time":"1.461583","lock_time":"0.000050","rows_sent":"500","rows_examined":"581000","command_text":"SELECT DN_N.record_id \"a.id\",DN_N.name \"a.name\",DN_N.valueN \"a.ExternalCode\",DN_N.valueN a.DeviceName\",DN_N.valueN \"a.DeviceDef\",DN_N.created_date \"a.createdDate\",DN_N.last_modified_date \"a.lastModifiedDate\",DN_N.valueN \"a.DeviceProduct\",DN_N.valueN \"a.Channel\",DN_N.valueN \"a.Status\",CN_N.valueN \"a.Remark\",DN_N.valueN \"a.NodeId\",DN_N.valueN \"a.ConnectStatus\",CAST(DN_N.valueN AS CHAR(N)) \"a.GatewayId\",CAST(DN_N.valueN AS CHAR(N)) \"a.HMI\",DN_N.valueN \"a.SerialNo\",CAST(DN_N.valueN AS DECIMAL(N,N)) \"a.TelemetryPeriod\",DN_N.valueN \"a.ConnectStatusChgTime\",DN_N.valueN \"a.DeviceNumber\",CAST(DN_N.valueN AS CHAR(N)) \"a.ControllerType\",CAST(DN_N.valueN AS CHAR(N)) \"a.ProjectId\",DN_N.valueN \"a.RegisterStatus\",DN_N.created_date ORD_FN FROM dataN DN_N,clobs CN_N WHERE (DN_N.tenant_id= N AND DN_N.obj_id= N AND DN_N.tenant_id= CN_N.tenant_id AND DN_N.obj_id= CN_N.obj_id AND DN_N.record_id= CN_N.record_id) AND ((DN_N.valueN = N)) ORDER BY DN_N.created_date DESC limit N,N;","database":"saas_perf","log_type":"slow_log","log_time":"1658890159","operate_type":"SELECT"}
- Structuring fields and description
Table 2 Structuring fields Field
Example
Description
Type
start_time
2022-07-27T02:49:19.000
SQL execution start time.
string
user
commerce
Username.
string
host
100.*.*.222
Connection IP address.
string
query_time
1.461583
SQL execution time.
string
lock_time
0.000050
Lock wait time.
string
rows_sent
500
Number of lines returned in the query.
string
rows_examined
581000
Number of lines scanned in the query.
string
command_text
SELECT DN_N.record_id \"a.id\",DN_N.name \"a.name\",DN_N.valueN \"a.ExternalCode\",DN_N.valueN \"a.DeviceName\",DN_N.valueN \"a.DeviceDef\",DN_N.created_date \"a.createdDate\",DN_N.last_modified_date \"a.lastModifiedDate\",DN_N.valueN \"a.DeviceProduct\",DN_N.valueN \"a.Channel\",DN_N.valueN \"a.Status\",CN_N.valueN \"a.Remark\",DN_N.valueN \"a.NodeId\",DN_N.valueN \"a.ConnectStatus\",CAST(DN_N.valueN AS CHAR(N)) \"a.GatewayId\",CAST(DN_N.valueN AS CHAR(N)) \"a.HMI\",DN_N.valueN \"a.SerialNo\",CAST(DN_N.valueN AS DECIMAL(N,N)) \"a.TelemetryPeriod\",DN_N.valueN \"a.ConnectStatusChgTime\",DN_N.valueN \"a.DeviceNumber\",CAST(DN_N.valueN AS CHAR(N)) \"a.ControllerType\",CAST(DN_N.valueN AS CHAR(N)) \"a.ProjectId\",DN_N.valueN \"a.RegisterStatus\",DN_N.created_date ORD_FN FROM dataN DN_N,clobs CN_N WHERE (DN_N.tenant_id= N AND DN_N.obj_id= N AND DN_N.tenant_id= CN_N.tenant_id AND DN_N.obj_id= CN_N.obj_id AND DN_N.record_id= CN_N.record_id) AND ((DN_N.valueN = N)) ORDER BY DN_N.created_date DESC limit N,N;
Executed SQL statement.
string
database
saas_perf
Used database.
string
log_type
slow_log
Log type.
string
log_time
1658890159
Log execution timestamp.
string
operate_type
SELECT
SQL operation type, such as select, update, and insert.
string
Structuring Template Details of GAUSSDB_MYSQL Error Logs
- GAUSSDB_MYSQL error log example
Table 3 Structuring template example Template Name
Example Log
GAUSSDB_MYSQL error logs
{"log_type":"error_log","severity":"WARNING","log_time":"2022-08-22T06:52:08Z","raw_message":"Occur error when reading bytes from a network handler. Client actively closes the connection."}
- Structuring fields and description
Table 4 Structuring fields Field
Example
Description
Type
log_type
error_log
Log type.
string
severity
WARNING
Log level.
string
log_time
2022-08-22T06:52:08Z
Time when an error log was generated.
string
raw_message
Occur error when reading bytes from a network handler. Client actively closes the connection.
Log content.
string
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