title: Elixir / Phoenix: How to customize HTTP request log format?
body: <p>By default, my Phoenix apps log basic information about each HTTP request across ~ 5 lines of log output. As long as I've set my log level to <code>:debug</code>, I can see each request's method, path, controller &amp; action, params, response code, and duration:</p>
  
  <pre><code>2019-06-14 16:05:35.099 [info] GET /manage/projects/7qDjSk
  2019-06-14 16:05:35.103 [debug] Processing with RTLWeb.Manage.ProjectController.show/2
    Parameters: %{"project_uuid" =&gt; "7qDjSk"}
    Pipelines: [:browser, :require_login]
  2019-06-14 16:05:35.116 [info] Sent 200 in 17ms
  </code></pre>
  
  <p>That's a great starting point. But I'd like to customize the app to log all of this info on one line, which is helpful eg. when sifting through large amounts of log output in a tool like <a href="https://papertrailapp.com/" rel="noreferrer">Papertrail</a>. In particular I'd like each request to show up in a format like this:</p>
  
  <pre><code>[PUT /manage/projects/74/prompts/290] params=%{"project_uuid" =&gt; "74", "prompt" =&gt; %{"html" =&gt; "&lt;div&gt;Test question 3&lt;/div&gt;"}, "prompt_uuid" =&gt; "290"} user=38 (Topher Hunt) status=302 redirected_to=/manage/projects/74 duration=423ms
  
  </code></pre>
  
  <p>In <a href="https://hexdocs.pm/phoenix/Phoenix.Controller.html#module-options" rel="noreferrer">the Phoenix.Controller docs</a> I see I can configure the log level for the Phoenix controller logging, or disable it altogether, but I don't see a way to customize the format. How can I do this?</p>