Skip to content

Commit

Permalink
cherry pick pingcap#27625 to release-5.3
Browse files Browse the repository at this point in the history
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
  • Loading branch information
SabaPing authored and ti-srebot committed Nov 26, 2021
1 parent 4a1b2e9 commit 1d9dc06
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions util/logutil/slow_query_logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,12 @@ var _pool = buffer.NewPool()

func newSlowQueryLogger(cfg *LogConfig) (*zap.Logger, *log.ZapProperties, error) {

// copy global config and override slow query log file
// if slow query log filename is empty, slow query log will behave the same as global log
// copy the global log config to slow log config
// if the filename of slow log config is empty, slow log will behave the same as global log.
sqConfig := cfg.Config
if len(cfg.SlowQueryFile) != 0 {
sqConfig.File = log.FileLogConfig{
MaxSize: cfg.File.MaxSize,
Filename: cfg.SlowQueryFile,
}
sqConfig.File = cfg.File
sqConfig.File.Filename = cfg.SlowQueryFile
}

// create the slow query logger
Expand Down

0 comments on commit 1d9dc06

Please sign in to comment.