From 6118cb65ff57bff9cea76302ddf7488a5d9733a9 Mon Sep 17 00:00:00 2001 From: Victor Date: Mon, 8 Apr 2024 12:54:05 +0200 Subject: [PATCH] docs: add a section about pino-logfmt (#1941) --- docs/transports.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/transports.md b/docs/transports.md index d6f289e25..859d7c325 100644 --- a/docs/transports.md +++ b/docs/transports.md @@ -423,6 +423,7 @@ PRs to this document are welcome for any new transports! + [pino-opentelemetry-transport](#pino-opentelemetry-transport) + [@axiomhq/pino](#@axiomhq/pino) + [pino-discord-webhook](#pino-discord-webhook) ++ [pino-logfmt](#pino-logfmt) ### Legacy @@ -1047,6 +1048,21 @@ const logger = pino({ }) ``` + +### pino-logfmt + +[pino-logfmt](https://github.com/botflux/pino-logfmt) is a Pino v7+ transport that formats logs into [logfmt](https://brandur.org/logfmt). This transport can output the formatted logs to stdout or file. + +```js +import pino from 'pino' + +const logger = pino({ + transport: { + target: 'pino-logfmt' + } +}) +``` + ## 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).