Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ContextKey = "extra"
View Source
var ErrorKeys = []string{"error", "err"}
View Source
var SourceKey = "source"
Functions ¶
func DefaultConverter ¶
Types ¶
type Option ¶
type Option struct {
// log level (default: debug)
Level slog.Leveler
// connection to syslog server
Writer io.Writer
// optional: customize json payload 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
}
Click to show internal directories.
Click to hide internal directories.