Question about the query-log-max-len parameter

This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: query-log-max-len 参数疑问

| username: TiDBer_KkruFifg

[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version]

[Reproduction Path] What operations were performed to encounter the issue
[Encountered Issue: Issue Phenomenon and Impact]
The official documentation describes the maximum length parameter for TiDB slow logs as follows, default 4096
The maximum length of SQL output.
Default value: 4096
When the statement length exceeds query-log-max-len, it will be truncated.

Under the default configuration, why does the TiDB slow log contain the following information? The following information is part of the slow log display.
len:5493 indicates that the length of this slow SQL is 5493 bytes? If so, why is it greater than the default 4096 bytes?

, 196"(len:5493);

[Resource Configuration] Enter TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachments: Screenshots/Logs/Monitoring]

| username: ShawnYan | Original post link

Check if the system variables have been changed?

For the new version, you can refer to the new documentation.

| username: 小龙虾爱大龙虾 | Original post link

Is the currently displayed SQL complete?

| username: 随缘天空 | Original post link

Does your SQL output exceed 4096 bytes? The log might record the complete SQL, but you need to confirm whether it was actually executed.

| username: zhanggame1 | Original post link

It may actually be less than 4096.

| username: TiDBer_JUi6UvZm | Original post link

Before v6.1.0, this switch could also be configured through the TiDB configuration file (log.query-log-max-len). After upgrading to v6.1.0, it can only be configured through system variables. So, what is the value of tidb_query_log_max_len?