title: Nodejs Winston Emit to socket
body: <p>I have implemented Winston to log my nodejs app.
  Currently I am writing the log to log files using the "DailyRotateFile" transport of Winston, and outputting the log data to the console.</p>
  
  <p>I want to add an additional transport that emits the log message to a socket so that I can output it to the web interface I have created using Express, through socket.io.</p>
  
  <p>This is the current way I have set up Winston:</p>
  
  <pre><code>  var logger = new winston.Logger({
      transports: [
          new winston.transports.DailyRotateFile({
              level: 'info',
              filename: './Logs/server',
              datePattern: '.yyyy-MM-dd.log',
              handleExceptions: true,
              json: true,
              maxsize: 5242880, // 5MB
              maxFiles: 5,
              colorize: false
          }),
          new winston.transports.Console({
              level: 'debug',
              handleExceptions: true,
              json: false,
              colorize: true
          })
      ],
      exitOnError: false
  })
  </code></pre>
  
  <p>This is the code the I currently use to emit the log message:</p>
  
  <pre><code>var logStream = logger.stream({
      start: -1
  })
  
  logStream.on('log', function(log){
      console.log('LOG STREAM')
      //console.log(log)
      io.emit('logger', log);
  })
  </code></pre>
  
  <p>This however continuously outputs "LOG STREAM" to the nodejs console when I start the server, and doesn't emit anything when I use the logger.info command.</p>
  
  <p><strong>EDIT</strong>
  So it looks like the reason the it continues to output "LOG STREAM" is because it is sending all the messages that have been saved in the log file, even though I set "start -1"</p>
  
  <p>I would really appreciate any suggestions as how to correctly achieve this. TIA!</p>