Skip to content

Instantly share code, notes, and snippets.

@youurayy
Created October 10, 2011 23:54
Show Gist options
  • Save youurayy/1276908 to your computer and use it in GitHub Desktop.
Save youurayy/1276908 to your computer and use it in GitHub Desktop.
TypeError: Cannot set property 'level' of null
var winston = require('winston');
winston.addColors({
debug: 'cyan',
event: 'magenta',
fail: 'inverse'
});
var log = new winston.Logger({
levels: {
debug: 0,
info: 1,
warn: 2,
error: 3,
event: 4,
fail: 5
}
});
log.on('error', function(e) {
console.log(e);
});
log.add(winston.transports.Console, {
timestamp: true,
colorize: true,
level: 'debug'
});
log.add(winston.transports.Loggly, {
level: 'error',
subdomain: '<SUBDOMAIN>',
auth: {
username: '<USERNAME>',
password: '<PASSWORD>'
},
inputName: '<INPUT-NAME>',
inputToken: '<INPUT-TOKEN>',
json: true
});
log.event('an event without metadata!');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment