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

Auto-notify when logging at the error level #294

Closed
dsuare1 opened this issue Aug 5, 2022 · 3 comments · Fixed by #299
Closed

Auto-notify when logging at the error level #294

dsuare1 opened this issue Aug 5, 2022 · 3 comments · Fixed by #299

Comments

@dsuare1
Copy link

dsuare1 commented Aug 5, 2022

I'm using the zap logging library and have recently added airbrake to the project.

I followed the quick example and configured my airbrake notifier with the correct project id and key, then manually called airbrake.Notify(...) and saw the error reported in my project. So I can confirm that the connection is working as expected.

My issue is that I don't want to have to go through my entire codebase and insert manual calls to airbrake.Notify(...) where relevant, but would rather configure airbrake to do so every time something is logged at the error level.

Is there a way to do this?

@chimanjain
Copy link
Contributor

Hi @dsuare1, currently we don't have an integration with zap logging library, but we have put this in our to do list to support zap logging library.

@dsuare1
Copy link
Author

dsuare1 commented Aug 10, 2022

Thanks @chimanjain - I was able to achieve what I wanted using zap's hooks. Only issue was that I had to refactor the initialization of my logger to take in the *gobrake.Notifier.

@chimanjain chimanjain linked a pull request Aug 23, 2022 that will close this issue
@chimanjain
Copy link
Contributor

Hi @dsuare1, I started working on zap integration with gobrake and I found an issue with zap's hooks that it doesn't capture []zapcore.Field. So I created a zap Core in #299 which sends the zap logs to airbrake.

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 a pull request may close this issue.

2 participants