cah-logger

2.5.0 • Public • Published

CAH-LOGGER

Built-in Environment Variables

  • DISABLE_LOGGER_STATS - set this to something truthy to disable statistics logging

Example Usage

var winston = require('winston');
var logger = require('cah-logger');

logger.configure(winston, {
  environment : process.env.NODE_ENV,
  extra : {
    application : 'YourApplicationName',
  },
  console : {
    level : process.env.TRACE ? 'trace' : 'debug'
  },
  logentries : {
    token : process.env.LOGENTRIES_TOKEN
  },
  rollbar : {
    token : process.env.ROLLBAR_TOKEN
  }
});

Logging unhandled promise rejections

Promise.onPossiblyUnhandledRejection(function(err) {
  winston.error(err);
  // At this point, it would be prudent to shut down or clean up or something
});

Dependencies (6)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i cah-logger

    Weekly Downloads

    2

    Version

    2.5.0

    License

    N/A

    Last publish

    Collaborators

    • bjy