-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc(adapters): add sub-package readme files
- Loading branch information
1 parent
8f667ce
commit 00a9d16
Showing
7 changed files
with
172 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Axiom Go Adapter for apex/log | ||
|
||
Adapter to ship logs generated by [apex/log](https://github.com/apex/log) to | ||
Axiom. | ||
|
||
## Quickstart | ||
|
||
Follow the [Axiom Go Quickstart](https://github.com/axiomhq/axiom-go#quickstart) | ||
to install the Axiom Go package and configure your environment. | ||
|
||
Import the package: | ||
|
||
```go | ||
// Imported as "adapter" to not conflict with the "apex/log" package. | ||
import adapter "github.com/axiomhq/axiom-go/adapters/apex" | ||
``` | ||
|
||
You can also configure the adapter using [options](https://pkg.go.dev/github.com/axiomhq/axiom-go/adapters/apex#Option) | ||
passed to the [New](https://pkg.go.dev/github.com/axiomhq/axiom-go/adapters/apex#New) | ||
function: | ||
|
||
```go | ||
handler, err := adapter.New( | ||
SetDataset("AXIOM_DATASET"), | ||
) | ||
``` | ||
|
||
To configure the underlying client manually either pass in a client that was | ||
created according to the [Axiom Go Quickstart](https://github.com/axiomhq/axiom-go#quickstart) | ||
using [SetClient](https://pkg.go.dev/github.com/axiomhq/axiom-go/adapters/apex#SetClient) | ||
or pass [client options](https://pkg.go.dev/github.com/axiomhq/axiom-go/axiom#Option) | ||
to the adapter using [SetClientOptions](https://pkg.go.dev/github.com/axiomhq/axiom-go/adapters/apex#SetClientOptions). | ||
|
||
```go | ||
import adapter "github.com/axiomhq/axiom-go/axiom" | ||
|
||
// ... | ||
|
||
handler, err := adapter.New( | ||
SetClientOptions( | ||
axiom.SetPersonalTokenConfig("AXIOM_TOKEN", "AXIOM_ORG_ID"), | ||
), | ||
) | ||
``` | ||
|
||
### ❗ Important ❗ | ||
|
||
The adapter uses a buffer to batch events before sending them to Axiom. This | ||
buffer must be flushed explicitly by calling [Close](https://pkg.go.dev/github.com/axiomhq/axiom-go/adapters/apex#Handler.Close). | ||
Checkout out the [example](../../examples/apex/main.go). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Axiom Go Adapter for sirupsen/logrus | ||
|
||
Adapter to ship logs generated by [sirupsen/logrus](https://github.com/sirupsen/logrus) | ||
to Axiom. | ||
|
||
## Quickstart | ||
|
||
Follow the [Axiom Go Quickstart](https://github.com/axiomhq/axiom-go#quickstart) | ||
to install the Axiom Go package and configure your environment. | ||
|
||
Import the package: | ||
|
||
```go | ||
// Imported as "adapter" to not conflict with the "sirupsen/logrus" package. | ||
import adapter "github.com/axiomhq/axiom-go/adapters/logrus" | ||
``` | ||
|
||
You can also configure the adapter using [options](https://pkg.go.dev/github.com/axiomhq/axiom-go/adapters/logrus#Option) | ||
passed to the [New](https://pkg.go.dev/github.com/axiomhq/axiom-go/adapters/logrus#New) | ||
function: | ||
|
||
```go | ||
hook, err := adapter.New( | ||
SetDataset("AXIOM_DATASET"), | ||
) | ||
``` | ||
|
||
To configure the underlying client manually either pass in a client that was | ||
created according to the [Axiom Go Quickstart](https://github.com/axiomhq/axiom-go#quickstart) | ||
using [SetClient](https://pkg.go.dev/github.com/axiomhq/axiom-go/adapters/logrus#SetClient) | ||
or pass [client options](https://pkg.go.dev/github.com/axiomhq/axiom-go/axiom#Option) | ||
to the adapter using [SetClientOptions](https://pkg.go.dev/github.com/axiomhq/axiom-go/adapters/logrus#SetClientOptions). | ||
|
||
```go | ||
import adapter "github.com/axiomhq/axiom-go/axiom" | ||
|
||
// ... | ||
|
||
hook, err := adapter.New( | ||
SetClientOptions( | ||
axiom.SetPersonalTokenConfig("AXIOM_TOKEN", "AXIOM_ORG_ID"), | ||
), | ||
) | ||
``` | ||
|
||
### ❗ Important ❗ | ||
|
||
The adapter uses a buffer to batch events before sending them to Axiom. This | ||
buffer must be flushed explicitly by calling [Close](https://pkg.go.dev/github.com/axiomhq/axiom-go/adapters/logrus#Hook.Close). | ||
Checkout out the [example](../../examples/logrus/main.go). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Axiom Go Adapter for uber-go/zap | ||
|
||
Adapter to ship logs generated by [uber-go/zap](https://github.com/uber-go/zap) | ||
to Axiom. | ||
|
||
## Quickstart | ||
|
||
Follow the [Axiom Go Quickstart](https://github.com/axiomhq/axiom-go#quickstart) | ||
to install the Axiom Go package and configure your environment. | ||
|
||
Import the package: | ||
|
||
```go | ||
// Imported as "adapter" to not conflict with the "uber-go/zap" package. | ||
import adapter "github.com/axiomhq/axiom-go/adapters/zap" | ||
``` | ||
|
||
You can also configure the adapter using [options](https://pkg.go.dev/github.com/axiomhq/axiom-go/adapters/zap#Option) | ||
passed to the [New](https://pkg.go.dev/github.com/axiomhq/axiom-go/adapters/zap#New) | ||
function: | ||
|
||
```go | ||
core, err := adapter.New( | ||
SetDataset("AXIOM_DATASET"), | ||
) | ||
``` | ||
|
||
To configure the underlying client manually either pass in a client that was | ||
created according to the [Axiom Go Quickstart](https://github.com/axiomhq/axiom-go#quickstart) | ||
using [SetClient](https://pkg.go.dev/github.com/axiomhq/axiom-go/adapters/zap#SetClient) | ||
or pass [client options](https://pkg.go.dev/github.com/axiomhq/axiom-go/axiom#Option) | ||
to the adapter using [SetClientOptions](https://pkg.go.dev/github.com/axiomhq/axiom-go/adapters/zap#SetClientOptions). | ||
|
||
```go | ||
import adapter "github.com/axiomhq/axiom-go/axiom" | ||
|
||
// ... | ||
|
||
core, err := adapter.New( | ||
SetClientOptions( | ||
axiom.SetPersonalTokenConfig("AXIOM_TOKEN", "AXIOM_ORG_ID"), | ||
), | ||
) | ||
``` | ||
|
||
### ❗ Important ❗ | ||
|
||
The adapter uses a buffer to batch events before sending them to Axiom. This | ||
buffer must be flushed explicitly by calling [Sync](https://pkg.go.dev/github.com/axiomhq/axiom-go/adapters/zap#WriteSyncer.Sync). Refer to the | ||
[zap documentation](https://pkg.go.dev/go.uber.org/zap/zapcore#WriteSyncer) | ||
for details and checkout out the [example](../../examples/zap/main.go). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters