Skip to content

Commit

Permalink
Update transports.md (#1897)
Browse files Browse the repository at this point in the history
add @axiomhq/pino: A pino transport which sends logs to Axiom.
  • Loading branch information
huijiewei committed Feb 7, 2024
1 parent 608d55b commit d7afda4
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions docs/transports.md
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ PRs to this document are welcome for any new transports!
+ [pino-slack-webhook](#pino-slack-webhook)
+ [pino-axiom](#pino-axiom)
+ [pino-opentelemetry-transport](#pino-opentelemetry-transport)
+ [@axiomhq/pino](#@axiomhq/pino)
### Legacy
Expand Down Expand Up @@ -999,6 +1000,35 @@ pino(transport)
Documentation on running a minimal example is available in the [README](https://github.com/Vunovati/pino-opentelemetry-transport#minimalistic-example).
<a id="@axiomhq/pino"></a>
### @axiomhq/pino
[@axiomhq/pino](https://www.npmjs.com/package/@axiomhq/pino) is the official [Axiom](https://axiom.co/) transport for Pino, using [axiom-js](https://github.com/axiomhq/axiom-js).
```javascript
import pino from 'pino';

const logger = pino(
{ level: 'info' },
pino.transport({
target: '@axiomhq/pino',
options: {
dataset: process.env.AXIOM_DATASET,
token: process.env.AXIOM_TOKEN,
},
}),
);
```
then you can use the logger as usual:
```js
logger.info('Hello from pino!');
```
For further examples, head over to the [examples](https://github.com/axiomhq/axiom-js/tree/main/examples/pino) directory.
<a id="communication-between-pino-and-transport"></a>
## Communication between Pino and Transports
Here we discuss some technical details of how Pino communicates with its [worker threads](https://nodejs.org/api/worker_threads.html).
Expand Down

0 comments on commit d7afda4

Please sign in to comment.