Skip to content

Commit

Permalink
tidb-server: log-slow-query command line option (#5484)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiancaiamao authored and coocood committed Dec 25, 2017
1 parent 2cccadc commit c799664
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tidb-server/main.go
Expand Up @@ -62,6 +62,7 @@ const (
nmRunDDL = "run-ddl"
nmLogLevel = "L"
nmLogFile = "log-file"
nmLogSlowQuery = "log-slow-query"
nmReportStatus = "report-status"
nmStatusPort = "status"
nmMetricsAddr = "metrics-addr"
Expand All @@ -86,8 +87,9 @@ var (
tokenLimit = flag.Int(nmTokenLimit, 1000, "the limit of concurrent executed sessions")

// Log
logLevel = flag.String(nmLogLevel, "info", "log level: info, debug, warn, error, fatal")
logFile = flag.String(nmLogFile, "", "log file path")
logLevel = flag.String(nmLogLevel, "info", "log level: info, debug, warn, error, fatal")
logFile = flag.String(nmLogFile, "", "log file path")
logSlowQuery = flag.String(nmLogSlowQuery, "", "slow query file path")

// Status
reportStatus = flagBoolean(nmReportStatus, true, "If enable status report HTTP service.")
Expand Down Expand Up @@ -286,6 +288,9 @@ func overrideConfig() {
if actualFlags[nmLogFile] {
cfg.Log.File.Filename = *logFile
}
if actualFlags[nmLogSlowQuery] {
cfg.Log.SlowQueryFile = *logSlowQuery
}

// Status
if actualFlags[nmReportStatus] {
Expand Down

0 comments on commit c799664

Please sign in to comment.