Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tidb: add general-log-file and compression #16719

Merged
merged 21 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions command-line-flags-for-tidb-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ aliases: ['/docs-cn/dev/command-line-flags-for-tidb-configuration/','/docs-cn/de
+ 默认:""
+ 如果未设置该参数,log 会默认输出到 "stderr";如果设置了该参数,log 会输出到对应的文件中。

## `--log-general`

+ [General Log](/system-variables.md#tidb_general_log) 文件名
+ 默认:""
+ 如果未设置该参数,general log 会默认输出到 [`--log-file`](#--log-file) 指定的文件中。

## `--log-slow-query`

+ 慢查询日志文件路径
Expand Down
13 changes: 13 additions & 0 deletions tidb-configuration-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,12 @@ TiDB 配置文件比命令行参数支持更多的选项。你可以在 [config/
+ 默认值:10000
+ 当查询的行数(包括中间结果,基于统计信息)大于这个值,该操作会被认为是 `expensive` 查询,并输出一个前缀带有 `[EXPENSIVE_QUERY]` 的日志。

### `general-log-file` <span class="version-mark">从 v8.0.0 版本开始引入</span>

+ 设置 [general log](/system-variables.md#tidb_general_log) 的文件名。
+ 默认值:""
+ 如果设置了文件名,general log 会输出到指定的文件。如没有设置文件名,general log 会写入 TiDB 实例的日志文件中,该文件名通过 [`filename`](#filename) 指定。

### `timeout` <span class="version-mark">从 v7.1.0 版本开始引入</span>

+ 用于设置 TiDB 写日志操作的超时时间。当磁盘故障导致日志无法写入时,该配置可以让 TiDB 进程崩溃而不是卡死。
Expand Down Expand Up @@ -351,6 +357,13 @@ TiDB 配置文件比命令行参数支持更多的选项。你可以在 [config/
+ 默认值:0
+ 默认全部保存;如果设置为 7,会最多保留 7 个老的日志文件。

#### `compression` <span class="version-mark">从 v8.0.0 版本开始引入</span>
Defined2014 marked this conversation as resolved.
Show resolved Hide resolved

+ 指定日志的压缩方式。
+ 默认值:""
+ 可选值:""、"gzip"
+ 默认值为 "" ,即不压缩。修改为 "gzip" 可以使用 gzip 算法压缩数据。开启压缩后会影响所有的日志文件,包括 [`slow-query-file`](#slow-query-file)、[`general-log-file`](#general-log-file-从-v800-版本开始引入) 等。

## security

安全相关配置。
Expand Down
Loading