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

Feature Request: Breadcrumbs #3

Open
odannyc opened this issue Aug 31, 2023 · 2 comments
Open

Feature Request: Breadcrumbs #3

odannyc opened this issue Aug 31, 2023 · 2 comments

Comments

@odannyc
Copy link

odannyc commented Aug 31, 2023

Hi, I'd like to have the ability for this package to also send Sentry breadcrumbs when the user logs at a certain level, for example logger.Info

@samber
Copy link
Owner

samber commented Aug 31, 2023

I suppose we might do something like that:

logger := slog.New(slogsentry.Option{Level: slog.LevelDebug}.NewSentryHandler())

entry := logger.With(slogsentry.Breadcrumb{ ... })

[...]

entry = entry.With(slogsentry.Breadcrumb{ ... })

[...]

entry = entry.With(slogsentry.Breadcrumb{ ... })

[...]

entry.Error("error")

WDYT ?

@YDKK
Copy link

YDKK commented Feb 14, 2024

It would be useful to be able to specify a MinimumBreadcrumbLevel in slogsentry.Option and automatically add logs above that level as Breadcrumb, like logger integration in other languages.
https://docs.sentry.io/platforms/dotnet/guides/extensions-logging/#minimumbreadcrumblevel

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

3 participants