title: How to customize Rails log messages to JSON format
body: <p>I need to customize log messages to a JSON format in my Rails app. </p>
  
  <p>To illustrate, currently the log messages my app produces look like this:</p>
  
  <pre><code>I, [2015-04-24T11:52:06.612993 #90159]  INFO -- : Started GET "/time_entries" for ::1 at 2015-04-24 11:52:06 -0400
  </code></pre>
  
  <p>As a result, log messages like the line above get written to my log.</p>
  
  <p>I need to change this format to JSON. How can I make the log output formatted exactly like the following example?</p>
  
  <pre><code>{
    "type" : "info",
    "time" : "2015-04-24T11:52:06.612993",
    "message" : "Started GET "/time_entries" for ::1 at 2015-04-24 11:52:06 -0400"
  }
  </code></pre>
  
  <p>Note: It doesn't need to be pretty printed like my example, it just has to have the JSON format.</p>