Skip to content

Commit

Permalink
Merge pull request #89 from aloknerurkar/fix/log-only-file
Browse files Browse the repository at this point in the history
Log only to file when it is specified
  • Loading branch information
Stebalien committed May 22, 2020
2 parents 8c45666 + 289dab5 commit 2cc31d7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion setup.go
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 2cc31d7

Please sign in to comment.