Use morgan(format, options) function signature.

This commit is contained in:
Payman Delshad
2015-02-23 11:02:44 +01:00
committed by Payman Delshad
parent 5a7602df7e
commit b0a0e3d58e
+2 -2
View File
@@ -107,14 +107,14 @@ var main = function (args, readyCb, doneCb) {
// not "Gb"). Using 1GB because..., well because it's arbitrary and 1GB is sufficiently large for 99.99%
// of testing scenarios while still providing an upperbounds to reduce the odds of squirrelliness.
rest.use(bodyParser.json({limit: '1gb'}));
rest.use(morgan({format: function (tokens, req, res) {
rest.use(morgan(function (tokens, req, res) {
// morgan output is redirected straight to winston
var data = '';
try {
if (req.body) data = JSON.stringify(req.body).substring(0, 1000);
} catch (ign) {}
logger.info(requestStartLoggingFormat(tokens, req, res), data.grey);
}, immediate: true}));
}, {immediate: true}));
rest.use(methodOverride());