I'm using node.js with express-winston for logging, like that:
var express = require('express');
var app = express();
var winston = require('winston');
var expressWinston = require('express-winston');
var routes = require('./routes/index');
app.use("/", routes);
app.use(
expressWinston.errorLogger({
transports: [
new winston.transports.DailyRotateFile({
name: 'file',
datePattern: '_dd-MM-yyyy.log',
colorize: true,
json: true,
filename: './logs/errors/error_log',
maxsize: 50 * 1024 * 1024,
maxFiles: 10,
zippedArchive: true
}),
new winston.transports.Console({
json: true,
colorize: true
})
],
skip: function(req, res) {
return true;
}
})
);
Notice that I'm using the skip function and returning true (for test purpose) in order to skip all error logging like written here: express-winston options
but it doesn't work, any ideas?