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

Logrus hook prints error if event has been dropped #578

Open
hnicke opened this issue Feb 10, 2023 · 3 comments
Open

Logrus hook prints error if event has been dropped #578

hnicke opened this issue Feb 10, 2023 · 3 comments

Comments

@hnicke
Copy link

hnicke commented Feb 10, 2023

When using the logrus hook to send logs to sentry, the following line is printed everytime the hook is triggered but the event is dropped (e.g. by using BeforeSend):

Failed to fire hook: failed to send to sentry

The log is triggered by this particular error.
I think this error should not be thrown at all since it's a valid scenario to drop sentry events client-side.

@hnicke
Copy link
Author

hnicke commented Feb 15, 2023

I have figured out that the error can be suppressed by setting a fallback:

hook.SetFallback(func(entry *log.Entry) error {
	return nil
})

Given this solution the PR is not needed anymore.

@hnicke hnicke closed this as completed Feb 15, 2023
@cleptric cleptric reopened this Feb 15, 2023
@cleptric
Copy link
Member

We actually need to change this 😄
As said in the PR, the HttpTransport always returns an ID, regardless if the event was actually successfully submitted over the wire.

@github-actions

This comment was marked as outdated.

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

Successfully merging a pull request may close this issue.

4 participants