From 0501c38ae701ecb155b9abaf48ce83356bb7be6d 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 4183b139f3715..c78ccd343d793 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1764,7 +1764,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 41036c6aa1df190e3bd5482c1cafe66d68c69aa3 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 c78ccd343d793..eb0c65aa8436b 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1764,7 +1764,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.