0.0.1 • Published 2 years ago

pino-test-francisco v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

pino-railtownai

A Pino v7+ transport to ship your logs to Railtownai

Installation

npm i @railtownai/pino-railtownai

Options

Usage

import pino from 'pino'

const logger = pino({
  transport: {
    target: '@railtownai/pino-railtownai',
    options: {
      token: 'your_token_here'
    }
  }
})

//or use environment variable 'RAILTOWN_TOKEN' and call it without the token key

const logger = pino({
  transport: {
    target: '@railtownai/pino-railtownai'
  }
})

Manually Logging Errors with additional properties

Import pinoLogger and use as follows:

try {
  // code to try 
} catch (error) {
  pinoLogger.error({
    err: error,
    userId: '123456789',
    projectId: 'abcdefg'
  });
}