From f11ec0b957e89840127a3e9ee0fdf9f889a85cba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luismi=20Rami=CC=81rez?= Date: Thu, 17 Oct 2024 13:04:57 +0200 Subject: [PATCH 1/2] docs->add appsignal pino transport --- docs/transports.md | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/docs/transports.md b/docs/transports.md index 9fd377abf..33234be2c 100644 --- a/docs/transports.md +++ b/docs/transports.md @@ -218,7 +218,7 @@ In case you want to both use a custom transport, and output the log entries with }, { target: 'my-custom-transport', - options: { someParameter: true } + options: { someParameter: true } } ] @@ -423,6 +423,7 @@ PRs to this document are welcome for any new transports! ### Pino v7+ Compatible ++ [@appsignal/nodejs pino](#@appsignal/nodejs-pino) + [@axiomhq/pino](#@axiomhq/pino) + [@logtail/pino](#@logtail/pino) + [@macfja/pino-fingers-crossed](#macfja-pino-fingers-crossed) @@ -467,6 +468,22 @@ PRs to this document are welcome for any new transports! + [pino-syslog](#pino-syslog) + [pino-websocket](#pino-websocket) + +### @appsignal/nodejs + +[@appsignal/nodejs](https://www.npmjs.com/package/@appsignal/nodejs) [`AppsignalPinoTransport`](https://github.com/appsignal/appsignal-nodejs/blob/0fffae87ebe269bb86b6adafba23388ecb802979/src/pino_transport.ts) is the official [AppSignal](https://appsignal.com/) transport for Pino. + +```javascript +import pino from 'pino'; +import { Appsignal, AppsignalPinoTransport } from '@appsignal/nodejs'; + +const logger = pino({ + AppsignalPinoTransport({ + client: Appsignal.client, + group: "optional-group-name", + }) +}); +``` ### @axiomhq/pino @@ -575,9 +592,9 @@ const pino = require('pino') const transport = pino.transport({ target: 'pino-axiom', options: { - orgId: 'YOUR-ORG-ID', - token: 'YOUR-TOKEN', - dataset: 'YOUR-DATASET', + orgId: 'YOUR-ORG-ID', + token: 'YOUR-TOKEN', + dataset: 'YOUR-DATASET', }, }) pino(transport) @@ -697,7 +714,7 @@ https://github.com/deviantony/docker-elk to setup an ELK stack. ### pino-discord-webhook -[pino-discord-webhook](https://github.com/fabulousgk/pino-discord-webhook) is a Pino v7+ compatible transport to forward log events to a [Discord](http://discord.com) webhook from a dedicated worker. +[pino-discord-webhook](https://github.com/fabulousgk/pino-discord-webhook) is a Pino v7+ compatible transport to forward log events to a [Discord](http://discord.com) webhook from a dedicated worker. ```js import pino from 'pino' @@ -1117,7 +1134,7 @@ Example output for the "hello world" log: ### pino-telegram-webhook -[pino-telegram-webhook](https://github.com/Jhon-Mosk/pino-telegram-webhook) is a Pino v7+ transport for sending messages to [Telegram](https://telegram.org/). +[pino-telegram-webhook](https://github.com/Jhon-Mosk/pino-telegram-webhook) is a Pino v7+ transport for sending messages to [Telegram](https://telegram.org/). ```js const pino = require('pino'); From af75f90ee4ede8d6746cfbed4eec0af59f97141e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luismi=20Rami=CC=81rez?= Date: Fri, 18 Oct 2024 12:34:11 +0200 Subject: [PATCH 2/2] docs->make AppSignal transport example .cjs --- docs/transports.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/docs/transports.md b/docs/transports.md index 33234be2c..9f92eddb5 100644 --- a/docs/transports.md +++ b/docs/transports.md @@ -471,17 +471,18 @@ PRs to this document are welcome for any new transports! ### @appsignal/nodejs -[@appsignal/nodejs](https://www.npmjs.com/package/@appsignal/nodejs) [`AppsignalPinoTransport`](https://github.com/appsignal/appsignal-nodejs/blob/0fffae87ebe269bb86b6adafba23388ecb802979/src/pino_transport.ts) is the official [AppSignal](https://appsignal.com/) transport for Pino. +[@appsignal/nodejs](https://www.npmjs.com/package/@appsignal/nodejs) [`AppsignalPinoTransport`](https://github.com/appsignal/appsignal-nodejs/blob/337eed9b72194f9500a685410fbfc9197c4db911/src/pino_transport.ts) is the official [AppSignal](https://appsignal.com/) transport for Pino. ```javascript -import pino from 'pino'; -import { Appsignal, AppsignalPinoTransport } from '@appsignal/nodejs'; +const pino = require('pino'); -const logger = pino({ - AppsignalPinoTransport({ - client: Appsignal.client, - group: "optional-group-name", - }) +pino({ + transport: { + target: "@appsignal/nodejs/pino", + options: { + group: "optional-grou-name", + } + } }); ```