From f7c5f17a8f851c034f87321ecebd431e08933c31 Mon Sep 17 00:00:00 2001 From: Aolin Date: Tue, 15 Nov 2022 16:50:21 +0800 Subject: [PATCH 1/2] Add a prerequisite before query "GENERAL_LOG" --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index b37ab3f507192..222832c2fc01f 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1343,7 +1343,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - This variable is used to set whether to record all SQL statements in the [log](/tidb-configuration-file.md#logfile). This feature is disabled by default. If maintenance personnel needs to trace all SQL statements when locating issues, they can enable this feature. -- To see all records of this feature in the log, query the `"GENERAL_LOG"` string. The following information is recorded: +- To see all records of this feature in the log, you need to set [`log.level`](/tidb-configuration-file.md#level) to `"info"` and then query the `"GENERAL_LOG"` string. The following information is recorded: - `conn`: The ID of the current session. - `user`: The current session user. - `schemaVersion`: The current schema version. From 666168726089b95c414026158bf9c40c0f3542db Mon Sep 17 00:00:00 2001 From: Aolin Date: Tue, 15 Nov 2022 17:15:59 +0800 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: CbcWestwolf <1004626265@qq.com> --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index 222832c2fc01f..8cf6de7e27cd3 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1343,7 +1343,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - This variable is used to set whether to record all SQL statements in the [log](/tidb-configuration-file.md#logfile). This feature is disabled by default. If maintenance personnel needs to trace all SQL statements when locating issues, they can enable this feature. -- To see all records of this feature in the log, you need to set [`log.level`](/tidb-configuration-file.md#level) to `"info"` and then query the `"GENERAL_LOG"` string. The following information is recorded: +- To see all records of this feature in the log, you need to set the TiDB configuration item [`log.level`](/tidb-configuration-file.md#level) to `"info"` or `"debug"` and then query the `"GENERAL_LOG"` string. The following information is recorded: - `conn`: The ID of the current session. - `user`: The current session user. - `schemaVersion`: The current schema version.