winston exclude routes

Solutions on MaxInterview for winston exclude routes by the best coders in the world

showing results for - "winston exclude routes"
Ariadna
17 Jan 2019
1var routeWhitelist = ['/foo', '/bar'];
2
3app.use(expressWinston.logger({
4  transports: [new winston.transports.Console()],
5  ignoreRoute: function (req, res) {
6    return routeWhitelist.indexOf(req.originalUrl || req.url) === -1;
7  }
8}));