title: How to log pretty printed json in PHP?
body: <p>I'm building an API in php. This API processes json messages from a third party API.</p>
  
  <p>I want to log invalid pretty printed json messages.</p>
  
  <p>So I did this:</p>
  
  <pre><code>error_log("test\n" . json_encode($json_string, JSON_PRETTY_PRINT));
  </code></pre>
  
  <p>However, when I look at my logs, the json string is not pretty printed:</p>
  
  <pre><code>$ tailf error.log
  2015-07-13 10:20:03: (mod_fastcgi.c.2701) FastCGI-stderr: test
  "{\"info\":{\"status\":200,\"msg\":\"OK\"},\"response\":{\"foo\":\"bar\"}"
  </code></pre>
  
  <p>I want to see something like:</p>
  
  <pre><code>$ tailf error.log
  2015-07-13 10:20:03: (mod_fastcgi.c.2701) FastCGI-stderr: test
  {
    "info": {
       "status": 200,
       "msg ": "OK"
    },
    "response": {
       "foo": "bar"
    }
  }
  </code></pre>
  
  <p>How can I achive this result?</p>