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
Trying to create a wrapper pkg for otelzap logger
package logger type logger struct { z *zap.SugaredLogger oz *otelzap.SugaredLogger } var globalLogger *logger func init() { level := getLoggerLevel(os.Getenv("LOGGER_LEVEL")) encoderConfig := zap.NewProductionEncoderConfig() encoderConfig.EncodeTime = zapcore.RFC3339TimeEncoder zapLogger, err := zap.Config{ Level: zap.NewAtomicLevelAt(level), Development: true, Encoding: "console", EncoderConfig: encoderConfig, OutputPaths: []string{"stderr"}, ErrorOutputPaths: []string{"stderr"}, }.Build(zap.WithCaller(true), zap.AddStacktrace(zapcore.ErrorLevel), zap.AddCallerSkip(1)) if err != nil { panic(err) } globalLogger = &logger{ z: zapLogger.Sugar(), oz: otelzap.New(zapLogger, otelzap.WithCaller(false), otelzap.WithTraceIDField(true)).Sugar(), } } func DebugwContext(ctx context.Context, msg string, keysAndValues ...interface{}) { globalLogger.oz.DebugwContext(ctx, msg, keysAndValues...) }
But when i try to execute DebugwContext which uses otelzap logger i see a caller(even if im passed caller false option and don't see a traceId field)
logger.DebugwContext(ctx, "i'm traced btw", []interface{}{}...) output: 2022-10-14T10:45:54+03:00 debug logger/logger.go:83 i'm traced btw
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Trying to create a wrapper pkg for otelzap logger
But when i try to execute DebugwContext which uses otelzap logger i see a caller(even if im passed caller false option and don't see a traceId field)
The text was updated successfully, but these errors were encountered: