Skip to content
New issue

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

agent with nrzap is not forwarding logs to newrelic #857

Closed
yehudamakarov opened this issue Feb 25, 2024 · 3 comments
Closed

agent with nrzap is not forwarding logs to newrelic #857

yehudamakarov opened this issue Feb 25, 2024 · 3 comments
Labels

Comments

@yehudamakarov
Copy link

Description

Steps to Reproduce

Expected Behavior

logs should arrive at newrelic

Your Environment

go container in google cloud run

@yehudamakarov
Copy link
Author

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
}

@yehudamakarov
Copy link
Author

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")
	}
	```

@yehudamakarov
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant