From 289dab554d5c9970b92e13fce985d9e600b83ee5 Mon Sep 17 00:00:00 2001 From: Alok Nerurkar Date: Fri, 22 May 2020 14:18:40 +0530 Subject: [PATCH] Log only to file when it is specified --- setup.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.go b/setup.go index 89771e3f71f4..a627a3a8c0c5 100644 --- a/setup.go +++ b/setup.go @@ -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} } }