Skip to content

Commit

Permalink
Log only to file when it is specified
Browse files Browse the repository at this point in the history
  • Loading branch information
aloknerurkar committed May 22, 2020
1 parent 8c45666 commit 289dab5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ func SetupLogging() {
if path, err := normalizePath(logfp); err != nil {
fmt.Fprintf(os.Stderr, "failed to resolve log path '%q', logging to stderr only: %s\n", logfp, err)
} else {
zapCfg.OutputPaths = append(zapCfg.OutputPaths, path)
// If file is specified, we will only log to the file
zapCfg.OutputPaths = []string{path}
}
}

Expand Down

0 comments on commit 289dab5

Please sign in to comment.