Search code examples
elastic-stackwinston

Prevent a winston transport from logging to the console


I am currently using this module and can't figure out how to turn off logs to the console.

var winston = require('winston');
var logzioWinstonTransport = require('winston-logzio');

var loggerOptions = {
  token: config.LOGZIO_API_KEY
};

winston.add(logzioWinstonTransport, loggerOptions);

winston.log('info', `${responseName}`, response);

Then to my console I get something like

info: List Identity Response error=null, response=[], success=true, id=undefined, firstName=undefined, lastName=undefined

How can I turn off that logging? Thanks!


Solution

  • You can use

    winston.remove(winston.transports.Console);