title: Winston is not properly working, I am unable to get all the console values in log file using winston
body: <p>I want to store all the <strong>console</strong> values in <strong>log file</strong> using Winstone, but I have ended up to store only the morgan values and not the console.log values in my log file.</p>
  
  <p><strong>And I also want to store the error values in my error.log file which I am unable to get it right now. Here below is my code.</strong></p>
  
  <blockquote>
    <p>winston.js file</p>
  </blockquote>
  
  <pre><code>var appRoot = require('app-root-path');
  var winston = require('winston');
  
  // define the custom settings for each transport (file, console)
  var options = {
    file: {
      level: 'info',
      filename: `${appRoot}/logs/app.log`,
      handleExceptions: true,
      json: true,
      maxsize: 5242880, // 5MB
      maxFiles: 5,
      colorize: false,
    },
    errorFile: {
     level: 'error',
     name: 'file.error',
     filename: `${appRoot}/logs/error.log`,
     handleExceptions: true,
     json: true,
     maxsize: 5242880, // 5MB
     maxFiles: 100,
     colorize: true,
   },
    console: {
      level: 'debug',
      handleExceptions: true,
      json: false,
      colorize: true,
    },
  };
  
  // instantiate a new Winston Logger with the settings defined above
  var logger = winston.createLogger({
    transports: [
      new winston.transports.File(options.file),
      new winston.transports.File(options.errorFile),
      new winston.transports.Console(options.console)
    ],
    exitOnError: false, // do not exit on handled exceptions
  });
  
  // create a stream object with a 'write' function that will be used by `morgan`
  logger.stream = {
    write: function(message, encoding) {
      logger.info(message);
    },
  };
  
  module.exports = logger;
  </code></pre>
  
  <blockquote>
    <p>main.js file</p>
  </blockquote>
  
  <pre><code>const express = require('express');
  const app=express();
  const morgon=require("morgan");
  
  
  var winston = require('./config/winston');
  app.use(morgon("combined", { stream: winston.stream }));
  </code></pre>