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

Flush issues on panic or fatal level #19

Closed
wants to merge 2 commits into from

Conversation

mikluke
Copy link
Contributor

@mikluke mikluke commented Oct 15, 2020

Now such code will send issue

hook, err := sentry.NewHook(sentry.Options{
	Dsn:              opts.SentryDSN,
	AttachStacktrace: true,
	Release:          health.GetVersion(),
}, logrus.PanicLevel, logrus.FatalLevel, logrus.ErrorLevel)

if err != nil {
	logrus.WithError(err).Fatal("failed to init sentry")
}

logrus.AddHook(hook)

logrus.WithError(errors.New("test")).Fatal("test")

@@ -1 +1,3 @@
module github.com/onrik/logrus
module github.com/Decentr-net/logrus
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've started using. I'll recreate pull request without this commit

@mikluke mikluke closed this Oct 16, 2020
@mikluke
Copy link
Contributor Author

mikluke commented Oct 16, 2020

#20

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

Successfully merging this pull request may close these issues.

2 participants