title: Morgan Logger with Express.js only logging failed requests
body: <p>I'm using Morgan with Express.js and I think I have a problem with my middleware because Morgan is only logging requests returning error 302 (redirected), which is occurring when my middleware catches an error and redirects to its error page.</p>
  
  <p>I'm fairly new to Express.js an all the middleware jazz so I would greatly appreciate any help.  Thanks!</p>
  
  <pre class="lang-js prettyprint-override"><code>var http = require('http')
      , express = require('express')
      , app = express()
      , logger = require('morgan');
  
  app.use(express.static(__dirname + '/public'));
  app.use(logger());
  
  var server = http.createServer(app);
  server.listen(8888);
  
  // Handle 404
  app.use(function(req, res) {
      res.status(404).redirect('/error/404.html');
  });
  
  // Handle 500
  app.use(function(error, req, res, next) {
      res.status(500).redirect('/error/500.html');
  });
  </code></pre>