Just another Pino transport.. But for Logtail!
A Transport to send logs to Logtail Platform.
npm i pino-logtail-transport
Use the transport as destination
const pino = require("pino");
const logtailTransport = pino.transport({
target: 'pino-logtail-transport',
options: {
debug: true,
logtailToken: process.env.LOGTAIL_AUTH_TOKEN,
},
});
const logger = pino(logtailTransport);
logger.info("Hello, Logtail!");
Both log on stdout and logtail
const pino = require("pino");
const stdoutTransport = pino.transport({
target: 'pino/file',
options: { destination: 1 },
});
const logtailTransport = pino.transport({
target: 'pino-logtail-transport',
options: {
logtailToken: process.env.LOGTAIL_AUTH_TOKEN,
},
});
const logger = pino({
level: "info",
},
pino.multistream([
stdoutTransport,
logtailTransport
]),
);
logger.info("Hello, Logtail!");;
logtailToken
(REQUIRED) auth token, provided by logtail platformdebug
(OPTIONAL) flag that trigger the _rawDebug() log (useful when debugging the transport)