Documentation
¶
Index ¶
- func New(handlers ...slog.Handler) *slog.Logger
- func NewAxiomHandler(ctx context.Context, otelService *observability.Service, dataset string, ...) (slog.Handler, func(context.Context), error)
- func NewAxiomHandlerFromEnv(ctx context.Context, otelService *observability.Service, options ...Option) (slog.Handler, func(context.Context), error)
- func NewConsoleHandler(options ...Option) slog.Handler
- func NewLoggingProviderWithProcessors(otelService *observability.Service, processors ...log.Processor) *log.LoggerProvider
- func NewOtelHandler(ctx context.Context, otelService *observability.Service, options ...Option) (slog.Handler, func(context.Context), error)
- func NewOtelLogProcessor(ctx context.Context, options ...Option) (log.Processor, error)
- type Option
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAxiomHandler ¶
func NewAxiomHandler(ctx context.Context, otelService *observability.Service, dataset string, apiKey string, options ...Option) (slog.Handler, func(context.Context), error)
NewAxiomHandler creates a new Axiom log handler, emitting logs to the given dataset and authenticating with the given API key.
func NewAxiomHandlerFromEnv ¶
func NewAxiomHandlerFromEnv(ctx context.Context, otelService *observability.Service, options ...Option) (slog.Handler, func(context.Context), error)
NewAxiomHandlerFromEnv creates a new Axiom log handler. It reads the following environment variables:
- AXIOM_API_KEY: The Axiom API key.
- AXIOM_LOGS_DATASET: The dataset where logs should be stored.
func NewConsoleHandler ¶
NewConsoleHandler creates a new console log handler.
func NewLoggingProviderWithProcessors ¶
func NewLoggingProviderWithProcessors(otelService *observability.Service, processors ...log.Processor) *log.LoggerProvider
NewLoggingProviderWithProcessors creates a new OpenTelemetry logger provider with the given processors.
Types ¶
type Option ¶
type Option func(*Options)
func WithEndpointURL ¶
WithEndpointURL sets the target endpoint URL (scheme, host, port, path) the Exporter will connect to.
func WithExportInterval ¶
WithExportInterval sets the maximum duration between batched exports. If set to 0, logs will not be batched.
Defaults to 1s.
func WithHeaders ¶
WithHeaders sets headers to send on each HTTP request.