Browse Source

log config output, splite by

pull/192/head
tinatwang 4 years ago
parent
commit
4f6043221c
  1. 2
      conf.sample.yml
  2. 2
      dtmcli/logger/log.go

2
conf.sample.yml

@ -50,7 +50,7 @@
# LogLevel: 'info' # default: info. can be debug|info|warn|error
# Log:
# Outputs: 'stderr' # default: stderr, split by |, you can append files to Outputs if need. example:'stderr|/tmp/test.log'
# Outputs: '' # default: stderr, split by ",", you can append files to Outputs if need. example:'stdout,/tmp/test.log'
# RotationEnable: 0 # default: 0
# RotationConfigJson: '{}' # example: '{"maxsize": 100, "maxage": 0, "maxbackups": 0, "localtime": false, "compress": false}'

2
dtmcli/logger/log.go

@ -49,7 +49,7 @@ func InitLog(level string) {
// InitLog2 specify advanced log config
func InitLog2(level string, outputs string, logRotationEnable int64, logRotateConfigJSON string) {
outputPaths := strings.Split(outputs, "|")
outputPaths := strings.Split(outputs, ",")
for i, v := range outputPaths {
if logRotationEnable != 0 && v != StdErr && v != StdOut {
outputPaths[i] = fmt.Sprintf("lumberjack://%s", v)

Loading…
Cancel
Save