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

Create an exp/slog.Handler #527

Open
earthboundkid opened this issue Jan 11, 2023 · 2 comments · May be fixed by #865
Open

Create an exp/slog.Handler #527

earthboundkid opened this issue Jan 11, 2023 · 2 comments · May be fixed by #865
Assignees

Comments

@earthboundkid
Copy link

The Go team have released an experimental structured logger. It is very likely to become a part of the standard library in the future. As a Sentry user, I would like any errors that I log with slog.Error to be sent to Sentry.

The simplest way for this to happen that I can think of is for Sentry to release some kind of slog.Handler that intercepts certain log calls and sends some Sentry before writing them to an underlying wrapped slog.Handler for output to stderr, etc.

@philippgille
Copy link

Go 1.21 was released a few days ago and the standard library now contains the structured logger: https://pkg.go.dev/log/slog

@earthboundkid
Copy link
Author

Someone wrote a client adapting Sentry to work with slog: https://github.com/samber/slog-sentry. For now, my plan is to integrate that, but ISTM, it should be merged in here.

@ribice ribice self-assigned this Mar 14, 2024
@ribice ribice linked a pull request Jul 28, 2024 that will close this issue
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