From cd489e1a5b2493a917935269eeec28ecab813214 Mon Sep 17 00:00:00 2001 From: Julien Ripouteau Date: Sun, 24 Apr 2022 16:34:44 +0200 Subject: [PATCH 1/2] docs: add `pino-loki` transport --- docs/transports.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/transports.md b/docs/transports.md index a7a9757c5..5ccd0f6dc 100644 --- a/docs/transports.md +++ b/docs/transports.md @@ -377,6 +377,7 @@ PR's to this document are welcome for any new transports! + [pino-elasticsearch](#pino-elasticsearch) + [pino-pretty](#pino-pretty) ++ [pino-loki](#pino-loki) ### Legacy @@ -390,6 +391,7 @@ PR's to this document are welcome for any new transports! + [pino-kafka](#pino-kafka) + [pino-logdna](#pino-logdna) + [pino-logflare](#pino-logflare) ++ [pino-loki](#pino-loki) + [pino-mq](#pino-mq) + [pino-mysql](#pino-mysql) + [pino-papertrail](#pino-papertrail) @@ -581,6 +583,28 @@ pino-mq -g For full documentation of command line switches and configuration see [the `pino-mq` readme](https://github.com/itavy/pino-mq#readme) + +### pino-loki +pino-loki is a transport that will forwards logs into [Grafana Loki](https://grafana.com/oss/loki/) +Can be used in CLI version in a separate process or in a dedicated worker : + +CLI : +```console +node app.js | pino-loki --hostname localhost:3100 --labels='{ "application": "my-application"}' --user my-username --password my-password +``` + +Worker : +```js +const pino = require('pino') +const transport = pino.transport({ + target: 'pino-loki', + options: { hostname: 'localhost:3100' } +}) +pino(transport) +``` + +Full documentation and configuration, see the [readme](https://github.com/Julien-R44/pino-loki) + ### pino-papertrail pino-papertrail is a transport that will forward logs to the [papertrail](https://papertrailapp.com) log service through an UDPv4 socket. From e12ec3343f36360b6de7b295d7913fcdf3edda92 Mon Sep 17 00:00:00 2001 From: Julien Ripouteau Date: Sun, 24 Apr 2022 16:35:41 +0200 Subject: [PATCH 2/2] docs: fix typo --- docs/transports.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/transports.md b/docs/transports.md index 5ccd0f6dc..9bd009e22 100644 --- a/docs/transports.md +++ b/docs/transports.md @@ -603,7 +603,7 @@ const transport = pino.transport({ pino(transport) ``` -Full documentation and configuration, see the [readme](https://github.com/Julien-R44/pino-loki) +For full documentation and configuration, see the [readme](https://github.com/Julien-R44/pino-loki) ### pino-papertrail