Closed yehudamakarov closed 5 months ago
i'm making a logger like this: and please note: the first message does not even come through to newrelic
func logger(app *newrelic.Application) (*zap.Logger, *zapcore.Core, error) {
core := zapcore.NewCore(zapcore.NewJSONEncoder(zap.NewProductionEncoderConfig()), zapcore.AddSync(os.Stdout), zap.InfoLevel)
backgroundCore, err := nrzap.WrapBackgroundCore(core, app)
if err != nil && err != nrzap.ErrNilApp {
panic(err)
}
logger, err := zap.New(backgroundCore), nil
logger.Info("this is working!")
return logger, &core, err
}
i'm setting up app
like so:
app, err := newrelic.NewApplication(
newrelic.ConfigAppName("my-service"),
newrelic.ConfigLicense("my-license"),
newrelic.ConfigDistributedTracerEnabled(true),
newrelic.ConfigAppLogForwardingEnabled(true),
)
if err != nil {
log.Fatal("could not init agent")
}
looks like they are coming in after a lot of delay, but they are missing transaction data. probably because i need to wrap with a transaction
Description
Steps to Reproduce
Expected Behavior
logs should arrive at newrelic
Your Environment
go container in google cloud run