Skip to content

docs: add tidb_general_log to TiDB configuration reference - #21960

Open
doc-claw-bot wants to merge 3 commits into
pingcap:masterfrom
doc-claw-bot:docs/add-tidb-general-log-config
Open

doc-claw-bot wants to merge 3 commits into
pingcap:masterfrom
doc-claw-bot:docs/add-tidb-general-log-config

Conversation

@doc-claw-bot

@doc-claw-bot doc-claw-bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

What is changed, added or deleted? (Required)

  • Add the missing instance.tidb_general_log entry to tidb-configuration-file.md.
  • Keep the Chinese configuration reference aligned with the matching English docs update.

Which TiDB version(s) do your changes apply to? (Required)

Tips for choosing the affected version(s):

By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.

For details, see tips for choosing the affected versions (in Chinese).

  • master (the latest development version)
  • v8.5 (TiDB 8.5 versions)
  • v8.4 (TiDB 8.4 versions)
  • v8.3 (TiDB 8.3 versions)
  • v8.2 (TiDB 8.2 versions)
  • v8.1 (TiDB 8.1 versions)
  • v7.5 (TiDB 7.5 versions)
  • v7.1 (TiDB 7.1 versions)
  • v6.5 (TiDB 6.5 versions)

What is the related PR or file link(s)?

AI agent involvement

  • The changes in this PR were primarily made by an AI agent on behalf of the PR author.

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

Summary by CodeRabbit

  • 新功能
    • 新增 instance.tidb_general_log 配置项,可控制是否在 TiDB 日志中记录成功执行的 SQL 语句。默认关闭;启用后,需将日志级别设为 info 或 debug 才能查看记录。
    • 配置文件中的设置在实例启动时生效;对应的系统变量 tidb_general_log 可动态修改当前实例的设置。可选值为 true 或 false。

@doc-claw-bot doc-claw-bot added type/bugfix This PR fixes a bug. area/general Relates to TiDB overview, architecture, and other general descriptions. translation/from-docs This PR is translated from a PR in pingcap/docs. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. labels Sep 29, 2026
@ti-chi-bot

ti-chi-bot Bot commented Sep 29, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign tangenta for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot added contribution This PR is from a community contributor. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Sep 29, 2026
@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

文档新增 instance.tidb_general_log 配置项说明。该配置项控制是否在 TiDB 日志中记录成功执行的 SQL 语句。查看这些记录时,需将 log.level 设为 "info" 或 "debug"。

Changes

TiDB 通用日志配置文档

Layer / File(s) Summary
新增配置项说明
tidb-configuration-file.md
新增 instance.tidb_general_log 说明,包含记录行为、日志级别要求、默认值和可选值。

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Suggested reviewers: qiancai

Merge Risk: 🔵 Low · up to c62de

Operators may mistakenly think statements that fail during execution will not appear in the general log. Correcting the description is a small documentation change; runtime behavior is unaffected.

Architecture Summary

Architecture risk: 🔵 Low · up to c62de

The change affects 1 system.

Changed systems: tidb-configuration-file.md

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — tidb-configuration-file.md (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in tidb-configuration-file.md: 新增 tidb_general_log 配置项,说明其与系统变量 tidb_general_log 的对应关系及配置文件和系统变量的设置方式,并注明成功执行 SQL 的日志记录条件、所需 log.level、默认值和可选值。
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 标题明确说明了主要变更,即在 TiDB 配置参考中新增 tidb_general_log。标题简洁且与变更内容一致。
Description check ✅ Passed 描述包含变更内容、适用版本、关联 PR 和参考链接,并标记了 AI agent 参与情况。描述与文件变更和 PR 目标一致。首次贡献者清单未提供,但该部分仅适用于首次贡献者,因此不影响整体完整性。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: pingcap/docs-cn/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 8749b8fb-d48f-46cb-8664-09d9102be30d

📥 Commits

Reviewing files that changed from the base of the PR and between b7adc67 and a76fe5b.

📒 Files selected for processing (1)
  • tidb-configuration-file.md

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Comment thread tidb-configuration-file.md Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: pingcap/docs-cn/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 13ee478a-4256-4bae-a7ce-5a0440ad6b2f

📥 Commits

Reviewing files that changed from the base of the PR and between 0968fd1 and c62de42.

📒 Files selected for processing (1)
  • tidb-configuration-file.md

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.

Comment on lines +926 to +932
### `tidb_general_log`

+ 用于控制是否在 TiDB 日志中记录成功执行的 SQL 语句。要查看这些记录,请将 [`log.level`](#level) 设置为 `"info"` 或 `"debug"`。
+ 该配置项对应系统变量 [`tidb_general_log`](/system-variables.md#tidb_general_log)。配置文件用于设置当前 TiDB 实例启动时的值,而系统变量可用于动态修改当前 TiDB 实例上的该设置。
+ 默认值:`false`
+ 可选值:`true` 或 `false`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

请改为描述“通过编译并进入执行阶段”的 SQL。

logStmt 在执行前调用。因此,已通过编译但执行时报错的 SQL 也会记录。只有编译错误会在调用 logStmt 前返回。当前“成功执行”会排除执行失败的 SQL,导致文档描述不准确。

Suggested fix
-用于控制是否在 TiDB 日志中记录成功执行的 SQL 语句。
+用于控制是否在 TiDB 日志中记录通过编译并进入执行阶段的 SQL 语句。
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
### `tidb_general_log`
+ 用于控制是否在 TiDB 日志中记录成功执行的 SQL 语句。要查看这些记录,请将 [`log.level`](#level) 设置为 `"info"` 或 `"debug"`。
+ 该配置项对应系统变量 [`tidb_general_log`](/system-variables.md#tidb_general_log)。配置文件用于设置当前 TiDB 实例启动时的值,而系统变量可用于动态修改当前 TiDB 实例上的该设置。
+ 默认值:`false`
+ 可选值:`true` 或 `false`
### `tidb_general_log`
用于控制是否在 TiDB 日志中记录通过编译并进入执行阶段的 SQL 语句。要查看这些记录,请将 [`log.level`](#level) 设置为 `"info"` 或 `"debug"`。
该配置项对应系统变量 [`tidb_general_log`](/system-variables.md#tidb_general_log)。配置文件用于设置当前 TiDB 实例启动时的值,而系统变量可用于动态修改当前 TiDB 实例上的该设置。
默认值:`false`
可选值:`true` 或 `false`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/general Relates to TiDB overview, architecture, and other general descriptions. contribution This PR is from a community contributor. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. translation/from-docs This PR is translated from a PR in pingcap/docs. type/bugfix This PR fixes a bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant