slog-sentry
slog-sentry copied to clipboard
Feature Request: Breadcrumbs
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
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 ?
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