title: Use express middleware morgan from exports
body: <p>I'm planning to use <code>morgan</code> for logging purpose in <code>express</code> application.<br/>
  I am able to use <code>morgan</code> in <code>server.js</code> file as: <code>app.use(morgan('tiny'))</code> and it works fine. However I want to put all logging related middleware into file called <code>logger.js</code>and use from it, without complicating <code>server.js</code> file.
  <br/>
  So <code>logger.js</code> looks as follows:</p>
  
  <pre><code>import morgan from 'morgan'
  import express from 'express'
  
  exports.morganLogger= function(req, res, next){
     morgan('tiny')
     next()   // Also tried commenting: next()
  } 
  </code></pre>
  
  <p>and use in <code>server.js</code> by <code>import morganLogger from './logger'</code> and tried <code>app.use(morganLogger)</code> and <code>app.use('\', morganLogger)</code> but it vain as it turn out to be not correct syntax for integrating middle-ware! 
  <br/> Either getting <code>TypeError('Router.use() requires a middleware function but got a ' + gettype(fn))</code> when <code>app.use('/', morganLogger)</code> and <code>TypeError: app.use() requires a middleware function</code> when <code>app.use(morganLogger)</code>.
  <br/>Is there a way to resolve this and use <code>morgan</code> as <code>express</code> middleware from external <code>js</code> file. </p>