title: How to info message and error message stored separate file using winston log file?
body: <p>I tried to logging info and errors in log file using winston.If any info stored info.log. If uncaught exception errors occurred its stored only error.log file.but If commom errors are occurred its stored both file(info .log and error.log) how to fix it any one give some solution.</p>
  
  <p><strong>winston.js</strong></p>
  
  <pre><code>const winston = require('winston');
  require('winston-mongodb');
  require('express-async-errors');
  
  const winstonLogger = function () {
  
      winston.add(new winston.transports.Console({
          format: winston.format.combine(
          winston.format.simple(),
          winston.format.timestamp(),
          winston.format.prettyPrint(),
          winston.format.colorize()
              ),
              handleExceptions: true
          }));
      // Info Log messages to file
      winston.add(new winston.transports.File({
          filename: 'logs/info.log',
          level: 'info'
      }));
      // Error Log Messages file
      winston.add(new winston.transports.File({
          filename: 'logs/error.log',
          level: 'error',
          handleExceptions: true,
      }));
  };
  
  module.exports = winstonLogger;
  
  </code></pre>
  
  <p>I want info message stored on info.log file and error message stored on error.log file.uncaught exception error stored in separate file using winston</p>