title: How log an HTTP JSON request in Loopback app deployed on Heroku?
body: <p>An app (Loopback) is deployed on Heroku, and I need to to see the req body (the JSON) send to this app for debugging purpose.</p>
  
  <p>So the access to the log is :</p>
  
  <pre><code>heroku logs --tail
  </code></pre>
  
  <p>The server.js is like the following :</p>
  
  <pre><code>var loopback = require('loopback');
  var boot = require('loopback-boot');
  
  var app = module.exports = loopback();
  
  app.start = function() {
    // start the web server
    return app.listen(function() {
      app.emit('started');
      console.log('Web server listening at: %s', app.get('url'));
    });
  };
  
  // Bootstrap the application, configure models, datasources and middleware.
  // Sub-apps like REST API are mounted via boot scripts.
  boot(app, __dirname, function(err) {
    if (err) throw err;
  
    // start the server if `$ node server.js`
    if (require.main === module)
      app.start();
  });
  </code></pre>