Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
App.prototype.configureExpressWinston = function () {
var app = this.express;
app.on('middleware:after:router', function addExpressWinston() {
app.use(expressWinston.errorLogger({
winstonInstance: logger._impl
}));
});
expressWinston.requestWhitelist = ['url', 'headers', 'method', 'httpVersion', 'originalUrl', 'query'];
expressWinston.bodyWhitelist = ['none'];
var ewLogger = expressWinston.logger({
winstonInstance: logger._impl,
msg: "{{req.method}} {{req.logSafeUrl}} {{res.statusCode}} {{res.responseTime}}ms",
meta: false
});
app.use(function (req, res, next) {
var badParams = /uuid=(.+[^0-9\-])/g;
req.logSafeUrl = req.url.replace(badParams, 'uuid=*');
return ewLogger(req, res, next);
});
};