Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AttributeKeyInvalidCharReplacement = "_"
View Source
var ErrorKeys = []string{"error", "err"}
View Source
var SourceKey = "source"
View Source
var SubAttributeSeparator = "__"
See:
Functions ¶
Types ¶
type LokiHandler ¶
type LokiHandler struct {
// contains filtered or unexported fields
}
type Option ¶
type Option struct { // log level (default: debug) Level slog.Leveler // loki Client *loki.Client // optional: customize webhook event builder Converter Converter // 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) NewLokiHandler ¶
Creating a Loki client at each `NewLokiHandler` call may lead to connection leak when chaining many operations: `logger.With(...).With(...).With(...).With(...)`
Click to show internal directories.
Click to hide internal directories.