Skip to content

Battlesquid/pino-parseable

Repository files navigation

pino-parseable

Pino v7+ transport for Parseable.

Install

Yarn

yarn add pino-parseable

NPM

npm i pino-parseable

Usage

import { pino } from "pino";
import { ParseableTransportOptions } from "pino-parseable";

const myUsername = "foo";
const myPassword = "bar";

const options: ParseableTransportOptions = {
    endpoint: "https://my-parseable-instance.com",
    stream: "my-test-stream",
    auth: {
        // provide your base64 encoded key directly
        key: Buffer.from(`${myUsername}:${myPassword}`).toString("base64"),
        // or provide your username and password as is
        username: myUsername,
        password: myPassword
    }
};

const logger = pino({
    transport: {
        target: "pino-parseable",
        options
    }
});

logger.info("Hello world");