I would like to log details regarding server requests into a file each time they occur.
What would be the optimal way to do this?
Currently using:
fs.open("./log_"+log_date.getMonth()+"-"+log_date.getDate(), "a+", function(err, fd){
if(err) {
sys.puts(err);
} else {
var logLineStr = JSON.stringify(log_line);
fs.write(fd, logLineStr,null,null,null, function(err, written, buffer) {
fs.close(fd);
});
}
});
Just use winston