Sails.js HOWTO: implement logging for HTTP requests

sails.js

Solution

There's no Sails config option to log every request, but you can add a quick logging route at the top of `config/routes.js` that should do the trick:

// config/routes.js
'/*': function(req, res, next) {sails.log.verbose(req.method, req.url); next();}

Problem

With the poor default logging of Sails.js not showing http request logs(even on verbose). What is the best way implement http request logging to console so i can see if I am getting malformed requests? Expressjs's default logging would be enough. I would prefer a Sails.js configuration way of doing it rather then a change the source code approach is possible. Has anyone had experience with this. My google searches seem oddly lacking information. Running Sails v0.9.8 on Mac OSX.

Original source