Skip to content

Commit

Permalink
put in a write place log file overwrite
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuznet committed Sep 24, 2024
1 parent e831687 commit b95b272
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ func Server(config string, port, metricsPort int, logFile string, useX509, scito
log.SetFlags(log.Lshortfile)
}
log.SetOutput(new(logging.LogWriter))
if logFile != "" {
log.Println("overwrite server log file to", logFile)
Config.LogFile = logFile
}
if Config.LogFile != "" {
rl, err := rotatelogs.New(LogName())
if err == nil {
Expand All @@ -66,10 +70,6 @@ func Server(config string, port, metricsPort int, logFile string, useX509, scito
log.Println("overwrite server metrics port number to", metricsPort)
Config.MetricsPort = metricsPort
}
if logFile != "" {
log.Println("overwrite server log file to", logFile)
Config.LogFile = logFile
}
if Config.Verbose > 0 {
log.Printf("%+v\n", Config.String())
}
Expand Down

0 comments on commit b95b272

Please sign in to comment.