Browse Source

embed: fix "--log-outputs" setup without "stderr"

Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
Gyuho Lee 6 years ago
parent
commit
f22c7c80c1
1 changed files with 4 additions and 1 deletions
  1. 4 1
      embed/config_logging.go

+ 4 - 1
embed/config_logging.go

@@ -170,7 +170,10 @@ func (cfg *Config) setupLogging() error {
 		}
 		}
 
 
 		if !isJournal {
 		if !isJournal {
-			copied := logutil.AddOutputPaths(logutil.DefaultZapLoggerConfig, outputPaths, errOutputPaths)
+			copied := logutil.DefaultZapLoggerConfig
+			copied.OutputPaths = outputPaths
+			copied.ErrorOutputPaths = errOutputPaths
+			copied = logutil.MergeOutputPaths(copied)
 			copied.Level = zap.NewAtomicLevelAt(logutil.ConvertToZapLevel(cfg.LogLevel))
 			copied.Level = zap.NewAtomicLevelAt(logutil.ConvertToZapLevel(cfg.LogLevel))
 			if cfg.Debug || cfg.LogLevel == "debug" {
 			if cfg.Debug || cfg.LogLevel == "debug" {
 				// enable tracing even when "--debug --log-level info"
 				// enable tracing even when "--debug --log-level info"