Created
October 10, 2011 23:54
-
-
Save youurayy/1276908 to your computer and use it in GitHub Desktop.
TypeError: Cannot set property 'level' of null
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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