title: Logging in Dash
body: <p>I have a Dash application and I am trying to get proper logging in place. So for that I am trying to implement that after every request my log handler captures the following things (please suggest best practices if I missed any): </p>
  
  <ul>
  <li>Time</li>
  <li>Type of the request method (Get/post)</li>
  <li>The path requested</li>
  <li>Request referrer</li>
  <li>Request agent</li>
  <li>Selected inputs and flags from the front end</li>
  <li>Response status</li>
  <li>Response content_length</li>
  <li>If I can capture the time between the request and response</li>
  </ul>
  
  <p>Is there a way to capture this? I tried looking but couldn't find out many things that I can log.</p>
  
  <p>So far the code I have is the following -</p>
  
  <pre class="lang-py prettyprint-override"><code>@dash_server.after_request
  def after_request(response):
      """ Logging after every request. """
      logger = logging.getLogger("app.access")
      logger.info("%s [%s] %s %s %s %s %s %s %s",
                  dt.utcnow().strftime("%d/%b/%Y:%H:%M:%S.%f")[:-3],
                  dash.callback_context.triggered,
                  dash.callback_context.inputs,
                  response.status,
                  response.content_length)
      return response
  </code></pre>
  
  <p>I am not sure how to capture the rest and I couldn't find a guide to perform this action.</p>