Documentation
¶
Overview ¶
Package slogsentry provides a slog Handler wrapper for the Sentry-go library.
Slog attributes are passed on to Sentry as context values. Some attribute keys are special. Attributes with a key prefixed with "tag_" are not stored in the context, but in the tags part of the Sentry event. The value of an attribute with the name "err" or "error" is included in the event message. Attributes with a name equal to a slog default key are ignored.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SentryHandler ¶
SentryHandler is a Handler that writes log records to the Sentry.
func NewSentryHandler ¶
func NewSentryHandler( handler slog.Handler, levels []slog.Level, ) *SentryHandler
NewSentryHandler creates a SentryHandler that writes to w, using the given options.
func (*SentryHandler) Enabled ¶
Enabled reports whether the handler handles records at the given level.
func (*SentryHandler) Handle ¶
Handle intercepts and processes logger messages. In our case, send a message to the Sentry.