title: Morgan Logger + Express.js: writing file AND showing in console
body: <p>I'm trying to use Morgan with Express.js to write a log file while showing my logs on the console as well.
  I'm using this code:</p>
  
  <pre><code>var logger = require('morgan');
  var accessLogStream = fs.createWriteStream('./access.log', {flags: 'a'});
  app.use(logger("dev",{stream: accessLogStream}));
  </code></pre>
  
  <p>But in this way I only get console logs and my access.log file remains empty.</p>
  
  <p>If I do this instead (not specifying "dev"):</p>
  
  <pre><code>var logger = require('morgan');
  var accessLogStream = fs.createWriteStream('./access.log', {flags: 'a'});
  app.use(logger({stream: accessLogStream}));
  </code></pre>
  
  <p>I get the logs on my file but not on the console. </p>
  
  <p>How can I obtain both the log on the console AND on the file?</p>
  
  <p>Thank you in advance!</p>
  
  <p>EDIT:
  at this moment I've found this solution:</p>
  
  <pre><code>app.use(logger({format:"[:date[clf]] :method :url :status :response-time ms",stream: {
      write: function(str)
      {
          accessLogStream.write(str);
          console.log(str);
      }
  }}));
  </code></pre>
  
  <p>But if you have a better one... you're welcome!</p>