Documentation
¶
Index ¶
Constants ¶
View Source
const BetterstackEndpoint = "https://in.logs.betterstack.com/"
Variables ¶
View Source
var ContextKey = "extra"
View Source
var ErrorKeys = []string{"error", "err"}
View Source
var SourceKey = "runtime"
Functions ¶
Types ¶
type BetterstackHandler ¶
type BetterstackHandler struct {
// contains filtered or unexported fields
}
type Option ¶
type Option struct {
// log level (default: debug)
Level slog.Leveler
// token
Token string
// optional: endpoint
Endpoint string
// default: 10s
Timeout time.Duration
// optional: customize record builder
Converter Converter
// optional: custom marshaler
Marshaler func(v any) ([]byte, error)
// optional: fetch attributes from context
AttrFromContext []func(ctx context.Context) []slog.Attr
// optional: see slog.HandlerOptions
AddSource bool
ReplaceAttr func(groups []string, a slog.Attr) slog.Attr
}
func (Option) NewBetterstackHandler ¶
Click to show internal directories.
Click to hide internal directories.