cah-logger
v2.5.0
Published
Common log setup for CAH services
Downloads
15
Readme
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
});