title: Winston not logging uncaught exceptions
body: <p>I'm trying to use winston to log unhandled exceptions to file and console. The problem is that it is not logging them. Here my setup:</p>
  
  <pre><code>var winston = require('winston');
  
  let file = process.env.APP_TOOL_SET_API_PROJECT+"/logs/app.log";
  console.log(process.env.APP_TOOL_SET_API_PROJECT);
  
  // define the custom settings for each transport (file, console)
  var options = {
    file: {
      level: 'info',
      filename: file,
      handleExceptions: true,
      json: true,
      maxsize: 5242880, // 5MB
      maxFiles: 5,
      colorize: false,
    },
    console: {
      level: 'debug',
      handleExceptions: false,
      json: true,
      colorize: true,
    },
  };
  
  // instantiate a new Winston Logger with the settings defined above
  var logger = winston.createLogger({
      format: winston.format.combine(
          //winston.format.label({ label: '[my-label]' }),
          winston.format.timestamp({
            format: 'YYYY-MM-DD HH:mm:ss'
          }),
          //
          // The simple format outputs
          // `${level}: ${message} ${[Object with everything else]}`
          //
          winston.format.simple(),
          //
          // Alternatively you could use this custom printf format if you
          // want to control where the timestamp comes in your final message.
          // Try replacing `format.simple()` above with this:
          //
          winston.format.printf(info =&gt; `${info.timestamp} ${info.level}: ${info.message}`)
      ),
      transports: [
          new winston.transports.File(options.file),
          new winston.transports.Console(options.console)
      ],
      exceptionHandlers: [
          new winston.transports.File({ filename: process.env.APP_TOOL_SET_API_PROJECT+"/logs/exceptions.log" }),
      ],
      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) {
      // use the 'info' log level so the output will be picked up by both transports (file and console)
      logger.info(message);
    },
  };
  
  module.exports = logger;
  </code></pre>
  
  <p>To add a bit more of information, if I wrap a thrown exception with setTimer it then is logged correctly.</p>
  
  <pre><code>setTimeout(() =&gt; {
      throw new Error('hello world');
    }, 250);
  </code></pre>
  
  <p>But this only would work for user thrown exceptions and feels really ugly to have to wrap each throw with setTimeout. </p>
  
  <p>Is there any solution for this?</p>