scratch-www/server/log.js
2015-09-03 22:26:56 -07:00

14 lines
316 B
JavaScript

var bunyan = require('bunyan');
module.exports = function () {
var logger = bunyan.createLogger({
name: 'www',
serializers: {req: bunyan.stdSerializers.req}
});
return function (req, res, next) {
req.log = logger;
req.log.info({req: req});
next();
};
};