Closed oddoye-david closed 8 years ago
I do understand the use case, but I think the request, response, and body whitelists cover most sensitive data that you don't want logged. I would think the route itself getting logged isn't really sensitive. Although maybe I'm just not thinking of good examples.
Anyway, you can make your own route whitelist using ignoreRoute
or skip
. Something like this is what you'd want (no guarantees about its quality, this is just some rough code):
var routeWhitelist = ['/foo', '/bar'];
app.use(expressWinston.logger({
transports: [new winston.transports.Console()],
ignoreRoute: function (req, res) {
return routeWhitelist.indexOf(req.originalUrl || req.url) === -1;
}
}));
Closed due to inactivity.
use req.path
if you want to ignore query params
const routeWhitelist = ['/foo', '/bar'];
app.use(expressWinston.logger({
transports: [new winston.transports.Console()],
ignoreRoute: function (req, res) {
return routeWhitelist.indexOf(req.path) === -1;
}
}));
Very stressful listing about 20 routes not to get logged, also routes like '/api/items?q=this' don't get picked up in the blacklist.