title: Node.js + Express - How to log the request body and response body
body: <p>I have a small api I have built using Node.js and express.
  I am trying to create a logger and I need log the request body AND response body.</p>
  
  <pre><code>app.use((req, res) =&gt; {
  
      console.log(req);            
  
      res.on("finish", () =&gt; {
  
          console.log(res);
  
      });
  
  });
  </code></pre>
  
  <blockquote>
    <p>"express": "^4.16.3",</p>
  </blockquote>
  
  <p>However, i am not able to find the body in the req or res object. Please tell me how i can get them. thanks.</p>