title: TypeError: winston.Logger is not a constructor with winston and morgan
body: <p>I tried with <code>Winston</code> for <code>logger</code>. I used in one project their It's working well when I copy paste the code from their to the current existing project than I face an issue like <code>TypeError: winston.Logger is not a constructor</code></p>
  
  <blockquote>
    <p>let logger = new (winston.Logger)({
                 ^</p>
    
    <p>TypeError: winston.Logger is not a constructor</p>
  </blockquote>
  
  <p>Please guide me, Why this error and what should I have to do for solving this issue.</p>
  
  <blockquote>
    <p>"morgan": "^1.9.0", "winston": "^3.0.0"</p>
  </blockquote>
  
  <p>Following is my code in <code>logger.js</code> file.</p>
  
  <pre><code>var appRoot = require('app-root-path');
  var winston = require('winston');
  
  var options = {
    file: {
      level: 'info',
      name: 'file.info',
      filename: `${appRoot}/logs/app.log`,
      handleExceptions: true,
      json: true,
      maxsize: 5242880, // 5MB
      maxFiles: 100,
      colorize: true,
    },
    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,
    },
  };
  
  
  // your centralized logger object
  let logger = new (winston.Logger)({
    transports: [
      new (winston.transports.Console)(options.console),
      new (winston.transports.File)(options.errorFile),
      new (winston.transports.File)(options.file)
    ],
    exitOnError: false, // do not exit on handled exceptions
  });
  </code></pre>