Log Levels

Winston uses different log levels. By default, they are:

  • error
  • warn
  • info
  • http
  • verbose
  • debug
  • silly

You can configure the level of logging you want. For example, if you only want to log info and above, you set the level to info.

const logger = winston.createLogger({
  level: 'info',
  format: winston.format.json(),
  transports: [
    new winston.transports.Console()
  ]
});

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *