We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello!
i am curious how i would migrate our zap gcloud implementation from v2.0.0-rc3 to v2.0.1 - i am thankful for every help!
v2.0.0-rc3
v2.0.1
func NewZap(development bool) (*zap.Logger, error) { var err error var logger *zap.Logger var loggerCfg = &zap.Config{ Level: zap.NewAtomicLevelAt(zapcore.InfoLevel), Development: development, Encoding: "json", EncoderConfig: zapcore.EncoderConfig{ TimeKey: "time", LevelKey: "severity", NameKey: "logger", CallerKey: "caller", MessageKey: "message", StacktraceKey: "stacktrace", LineEnding: zapcore.DefaultLineEnding, EncodeLevel: func(l zapcore.Level, enc zapcore.PrimitiveArrayEncoder) { switch l { case zapcore.DebugLevel: enc.AppendString("DEBUG") case zapcore.InfoLevel: enc.AppendString("INFO") case zapcore.WarnLevel: enc.AppendString("WARNING") case zapcore.ErrorLevel: enc.AppendString("ERROR") case zapcore.DPanicLevel: enc.AppendString("CRITICAL") case zapcore.PanicLevel: enc.AppendString("ALERT") case zapcore.FatalLevel: enc.AppendString("EMERGENCY") } }, EncodeTime: zapcore.RFC3339TimeEncoder, EncodeDuration: zapcore.MillisDurationEncoder, EncodeCaller: zapcore.ShortCallerEncoder, }, OutputPaths: []string{"stdout"}, ErrorOutputPaths: []string{"stderr"}, } if logger, err = loggerCfg.Build(zap.AddStacktrace(zap.DPanicLevel)); err != nil { return nil, err } return logger, nil }
logging.StreamServerInterceptor(grpczap.InterceptorLogger(logger)),
The text was updated successfully, but these errors were encountered:
There's an example, does that help? https://github.com/grpc-ecosystem/go-grpc-middleware/blob/main/interceptors/logging/examples/zap/example_test.go
Sorry, something went wrong.
Yeah that works perfectly - was just curious if the lvls matches Thanks @johanbrandhorst
lvl
No branches or pull requests
Hello!
i am curious how i would migrate our zap gcloud implementation from
v2.0.0-rc3
tov2.0.1
- i am thankful for every help!The text was updated successfully, but these errors were encountered: