Skip to content

Commit d7afda4

Browse files
authored
Update transports.md (#1897)
add @axiomhq/pino: A pino transport which sends logs to Axiom.
1 parent 608d55b commit d7afda4

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

docs/transports.md

+30
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@ PRs to this document are welcome for any new transports!
421421
+ [pino-slack-webhook](#pino-slack-webhook)
422422
+ [pino-axiom](#pino-axiom)
423423
+ [pino-opentelemetry-transport](#pino-opentelemetry-transport)
424+
+ [@axiomhq/pino](#@axiomhq/pino)
424425
425426
### Legacy
426427
@@ -999,6 +1000,35 @@ pino(transport)
9991000
10001001
Documentation on running a minimal example is available in the [README](https://github.com/Vunovati/pino-opentelemetry-transport#minimalistic-example).
10011002
1003+
<a id="@axiomhq/pino"></a>
1004+
### @axiomhq/pino
1005+
1006+
[@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).
1007+
1008+
```javascript
1009+
import pino from 'pino';
1010+
1011+
const logger = pino(
1012+
{ level: 'info' },
1013+
pino.transport({
1014+
target: '@axiomhq/pino',
1015+
options: {
1016+
dataset: process.env.AXIOM_DATASET,
1017+
token: process.env.AXIOM_TOKEN,
1018+
},
1019+
}),
1020+
);
1021+
```
1022+
1023+
then you can use the logger as usual:
1024+
1025+
```js
1026+
logger.info('Hello from pino!');
1027+
```
1028+
1029+
For further examples, head over to the [examples](https://github.com/axiomhq/axiom-js/tree/main/examples/pino) directory.
1030+
1031+
10021032
<a id="communication-between-pino-and-transport"></a>
10031033
## Communication between Pino and Transports
10041034
Here we discuss some technical details of how Pino communicates with its [worker threads](https://nodejs.org/api/worker_threads.html).

0 commit comments

Comments
 (0)