hookio/hook.io — pull request #159 by rajkissu (2012-02-01 04:36:15+00:00)
Title: Winston support

This pull request adds winston support to hook.log() and it's accompanying test cases. It also allows configuration of winston either directly during instantiation or from config.json, example as follows:

// config.json

"logger" : {
"transports" : {
"file" : {
"filename" : "/path/to/somefile.log",
}
},

"exceptionHandlers" : {
"file" : {
"filename" :
"/path/to/exceptions.log"
}
},

"handleExceptions" : true,
"exitOnError" : false
}

// during instantiation

new Hook({
logger : {
transports : [
new (winston.transports.Console)(),

new (winston.transports.File)({
filename : 'err.log',
handleExceptions : true
})
]
}
});