From 6ab22f16745390444e89c1359031bfd1c9c91c88 Mon Sep 17 00:00:00 2001 From: "binbin.zhang" Date: Wed, 2 Mar 2022 11:00:30 +0800 Subject: [PATCH] log support stdout (#415) --- common/logger/logger.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/logger/logger.go b/common/logger/logger.go index c1042144..49fa98dc 100644 --- a/common/logger/logger.go +++ b/common/logger/logger.go @@ -127,7 +127,7 @@ func InitNacosLogger(config Config) (Logger, error) { logLevel := getLogLevel(config.Level) encoder := getEncoder() writer := config.getLogWriter() - core := zapcore.NewCore(zapcore.NewConsoleEncoder(encoder), writer, logLevel) + core := zapcore.NewCore(zapcore.NewConsoleEncoder(encoder), zapcore.NewMultiWriteSyncer(writer, zapcore.AddSync(os.Stdout)), logLevel) if config.Sampling != nil { core = zapcore.NewSamplerWithOptions(core, config.Sampling.Tick, config.Sampling.Initial, config.Sampling.Thereafter)