Use the adapter of the Axiom Go SDK to send logs generated by the sirupsen/logrus library to Axiom.Documentation Index
Fetch the complete documentation index at: https://axiom.co/docs/llms.txt
Use this file to discover all available pages before exploring further.
The Axiom Go SDK is an open-source project and welcomes your contributions. For more information, see the GitHub repository.
Prerequisites
- Create an Axiom account.
- Create a dataset in Axiom where you send your data.
- Create an API token in Axiom with permissions to ingest data to the dataset you have created.
Set up SDK
- Install the Axiom Go SDK and configure your environment as explained in Send data from Go app to Axiom.
-
In your Go app, import the
logruspackage. It’s imported as anadapterso that it doesn’t conflict with thesirupsen/logruspackage.
DATASET_NAME with the name of the Axiom dataset where you send your data.
Configure client
To configure the underlying client manually, choose one of the following:- Use SetClient to pass in the client you have previously created with Send data from Go app to Axiom.
- Use SetClientOptions to pass client options to the adapter.
The adapter uses a buffer to batch events before sending them to Axiom. Flush this buffer explicitly by calling Close. For more information, see the example in GitHub.