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

Use release and environment from raven client #84

Open
montanaflynn opened this issue Apr 2, 2019 · 1 comment
Open

Use release and environment from raven client #84

montanaflynn opened this issue Apr 2, 2019 · 1 comment

Comments

@montanaflynn
Copy link

I'm using the hook with a raven client like so:

ravenClient, err := raven.New(sentryDSN)
if err != nil {
	log.Fatal(err)
}

ravenClient.SetRelease(release)
ravenClient.SetEnvironment(environment)

// set up error logs and stacktrace to send to sentry
hook, err := logrus_sentry.NewAsyncWithClientSentryHook(ravenClient, []logrus.Level{
	logrus.PanicLevel,
	logrus.FatalLevel,
	logrus.ErrorLevel,
})
logger.Hooks.Add(hook)

But the hook isn't sending the correct release or environment. I think I have to set them manually on the hook like this:

hook.SetRelease(release)
hook.SetEnvironment(environment)

It would be nice for this package to use the already configured release and environment from the raven client used to create the hook.

@thomas-lee
Copy link

I have tried, it now works without further setting.

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

No branches or pull requests

2 participants