diff --git a/pkg/log/log.go b/pkg/log/log.go index b952e0ea24..7b903f642c 100644 --- a/pkg/log/log.go +++ b/pkg/log/log.go @@ -103,19 +103,11 @@ func InitLoggers(globalCfg GlobalConfig, subCfgs map[string]GlobalConfig, opts . consoleCfg.EncoderConfig.EncodeLevel = zapcore.CapitalColorLevelEncoder cores = append(cores, zapcore.NewCore( zapcore.NewConsoleEncoder(consoleCfg.EncoderConfig), - zapcore.Lock(os.Stderr), - zap.InfoLevel)) - - coreOpt := zap.WrapCore(func(zapcore.Core) zapcore.Core { - return zapcore.NewTee(cores...) - }) - var buildOpts []zap.Option - buildOpts = append(buildOpts, coreOpt) - buildOpts = append(buildOpts, opts...) - logger, err := cfg.Zap.Build(buildOpts...) - if err != nil { - return err - } + zapcore.AddSync(os.Stdout), + cfg.Zap.Level)) + + core := zapcore.NewTee(cores...) + logger := zap.New(core, opts...) _logMu.Lock() if name == _globalLoggerName { diff --git a/server/main.go b/server/main.go index a405da4e8a..2bb316173c 100644 --- a/server/main.go +++ b/server/main.go @@ -169,7 +169,7 @@ func main() { func initLogger(cfg config.Config) error { addr := cfg.Chain.ProducerAddress() - return log.InitLoggers(cfg.Log, cfg.SubLogs, zap.Fields( + return log.InitLoggers(cfg.Log, cfg.SubLogs, zap.AddCaller(), zap.Fields( zap.String("ioAddr", addr.String()), )) }