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

Merged
merged 6 commits into from Oct 20, 2017

Conversation

Projects
None yet
6 participants
@tiancaiamao
Contributor

tiancaiamao commented Oct 17, 2017

Support this config option, then slow query log will be redirect to the separate files:

[log]
slow-query-file = "slow-query.log"

This PR also remove pd/pkg/logutil and create a tidb/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 and slow_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.

@shenli

This comment has been minimized.

Show comment
Hide comment
@shenli

shenli Oct 17, 2017

Member

Please fix CI.

Member

shenli commented Oct 17, 2017

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 = ""

This comment has been minimized.

@zimulala

zimulala Oct 19, 2017

Member

Remove #?

@zimulala

zimulala Oct 19, 2017

Member

Remove #?

This comment has been minimized.

@tiancaiamao

tiancaiamao Oct 20, 2017

Contributor

We should not set it by default, merge the output of slow query to standard log will be helpful for debugging.

@tiancaiamao

tiancaiamao Oct 20, 2017

Contributor

We should not set it by default, merge the output of slow query to standard log will be helpful for debugging.

@zimulala

This comment has been minimized.

Show comment
Hide comment
@zimulala

zimulala Oct 19, 2017

Member

Add a unit test for SlowQueryLogger ?

Member

zimulala commented Oct 19, 2017

Add a unit test for SlowQueryLogger ?

@winkyao

Why you move the logutil/log.go from vendor/pd to TiDB, not just copy the file?

@tiancaiamao

This comment has been minimized.

Show comment
Hide comment
@tiancaiamao

tiancaiamao Oct 20, 2017

Contributor

This PR also remove pd/pkg/logutil and create a tidb/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.

@winkyao

Contributor

tiancaiamao commented Oct 20, 2017

This PR also remove pd/pkg/logutil and create a tidb/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.

@winkyao

@coocood

This comment has been minimized.

Show comment
Hide comment
@coocood

coocood Oct 20, 2017

Member

LGTM

Member

coocood commented Oct 20, 2017

LGTM

@coocood coocood added the status/LGT1 label Oct 20, 2017

@winkyao

LGTM

@jackysp jackysp merged commit 7afae3f into master Oct 20, 2017

5 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls First build on master at 72.583%
Details
jenkins-ci-tidb/build Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details

@jackysp jackysp deleted the tiancaiamao/slow-log branch Oct 20, 2017

tiancaiamao added a commit to tiancaiamao/tidb that referenced this pull request Oct 22, 2017

shenli added a commit to shenli/tidb that referenced this pull request Oct 24, 2017

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