-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
*: support write slow query log into seperate files #4804
Conversation
Please fix CI. |
@@ -37,6 +37,9 @@ format = "text" | |||
# Disable automatic timestamps in output | |||
disable-timestamp = false | |||
|
|||
# Stores slow query log into seperate files. | |||
#slow-query-file = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove #
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not set it by default, merge the output of slow query to standard log will be helpful for debugging.
Add a unit test for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why you move the logutil/log.go from vendor/pd to TiDB, not just copy the file?
|
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Support this config option, then slow query log will be redirect to the separate files:
This PR also remove
pd/pkg/logutil
and create atidb/util/logutil
package, because log config in Pd is somehow different with TiDB. For example, TiDB doesn't need to handle etcd log, while Pd doesn't need to collect slow query log.Using
slow_query_log
andslow_query_log_file
SQL variable to control the slow query log is not supported deliberately, because global session variable will change all TiDB instance's behavior, the deploy environment of the instances maybe diverse, however.