How to change laravel logs format?
<p>I need change the format of laravel logs to json format like this:</p>

<pre><code>{
   "time":"2015-10-06 15:45:36",
   "host":"192.000.000",
   "protocol”:”http, tcp",
   "remote-addrress": "192.000.001",
   "user":"user-logged",
   "level": "warning",
   "message":"exception",
}  
</code></pre>

<p>How to do this?</p>

<p>I try put the next code in bootstrap/app.php but I don't know how to change the json format/object.</p>

<pre><code>$app-&gt;configureMonologUsing(function ($monolog) use ($app) {
    // Stream handlers
    $logPath = $app-&gt;storagePath().'/logs/test.log';
    $logLevel = \Monolog\Logger::DEBUG;

    $logStreamHandler = new \Monolog\Handler\StreamHandler($logPath, $logLevel);

    $formatter = new \Monolog\Formatter\JsonFormatter();
    $logStreamHandler-&gt;setFormatter($formatter);
    $monolog-&gt;pushHandler($logStreamHandler);
});
</code></pre>

<p>this is the result:</p>

<pre><code>{
   "message":"info",
   "context":[
   ],
   "level":200,
   "level_name":"INFO",
   "channel":"local",
   "datetime":{
      "date":"2016-09-22 10:33:38.318064",
      "timezone_type":3,
      "timezone":"UTC"
   },
   "extra":[

   ]
}
</code></pre>