winston-test-francisco
TypeScript icon, indicating that this package has built-in type declarations

0.0.10 • Public • Published

winston-railtown

winston-railtown is a transport to ship your logs to railtown.ai

For testing purposes only

Install

$ npm install --save @railtownai/winston-railtownai

Options

  • token: Your railtown token [required]

Usage

const winston = require('winston')
import RailtownTransport from '@railtownai/winston-railtownai')

var logger = winston.createLogger({
  // Whatever options you need
  // Refer https://github.com/winstonjs/winston#creating-your-own-logger
})

logger.add(
  new RailtownTransport({
    token: 'your_token_here',
    ... //winston transport options
  })
)

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

logger.add(
  new RailtownTransport({
    ... //winston transport options
  })
)

Manually Logging Errors with additional properties

Import winstonLogger and use as follows:

try {
  // code to try 
} catch (error) {
  const logError = {
    message: error.message,
    stack: error.stack,
    userId: '123456789',
    projectId: 'abcdefg'
  };

  winstonLogger.error(logError);
}

Package Sidebar

Install

npm i winston-test-francisco

Weekly Downloads

1

Version

0.0.10

License

MIT

Unpacked Size

13.9 kB

Total Files

7

Last publish

Collaborators

  • francisco-matamoros