Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrMissingDatasetName = errors.New("missing dataset name")
ErrMissingDatasetName is raised when a dataset name is not provided. Set it manually using the SetDataset option or export `AXIOM_DATASET`.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler implements a `log.Handler` used for shipping logs to Axiom.
func New ¶
New creates a new `Handler` configured to ingest logs to the Axiom deployment and dataset as specified by the environment. Refer to `axiom.NewClient()` for more details on how configuring the Axiom deployment works or pass the `SetClient()` option to pass a custom client or `SetClientOptions()` to control the Axiom client creation. To specify the dataset set `AXIOM_DATASET` or use the `SetDataset()` option.
An ingest token is sufficient enough. Additional options can be supplied to configure the `Handler`. A handler needs to be closed properly to make sure all logs are sent by calling `Close()`.
type Option ¶
An Option modifies the behaviour of the Axiom handler.
func SetClient ¶ added in v0.4.0
SetClient specifies the Axiom client to use for ingesting the logs.
func SetClientOptions ¶ added in v0.4.0
SetClientOptions specifies the Axiom client options to pass to `axiom.NewClient()`. `axiom.NewClient()` is only called if no client was specified by the `SetClient` option.
func SetDataset ¶ added in v0.4.0
SetDataset specifies the dataset to ingest the logs into. Can also be specified using the `AXIOM_DATASET` environment variable.
func SetIngestOptions ¶ added in v0.4.0
func SetIngestOptions(opts axiom.IngestOptions) Option
SetIngestOptions specifies the ingestion options to use for ingesting the logs.