Skip to content

bortolottidev/pino-logtail-transport

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pino-logtail-transport

Just another Pino transport.. But for Logtail!

A Transport to send logs to Logtail Platform.

Installation

npm i pino-logtail-transport

Usage

Basic Usage

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!");

Multistream Usage

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!");;

Options

  • logtailToken (REQUIRED) auth token, provided by logtail platform
  • debug (OPTIONAL) flag that trigger the _rawDebug() log (useful when debugging the transport)

About

Just another Pino transport.. But for Logtail!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published