title: How can I send json formatted log entries to Loggly with Laravel 5.6
body: <p>I've followed what I think is the correct setup for Loggly as a Monolog channel with Laravel 5.6 but I keep getting strings of text instead of json searchable entries. E.g:</p>
  <blockquote>
  <p>[2018-07-27 14:50:20] local.INFO: array (
  'foo' =&gt; 'bar',
  )</p>
  </blockquote>
  <p>This is from the 'unparsed' property of the Loggly entry. Not a valid json by any stretch!!!</p>
  <p>Here are some relevant snippets of code to show how the loggly channel is set up and how I trigger the log entry.</p>
  <p><strong>config/logging.php:</strong></p>
  <pre><code>'loggly' =&gt; [
          'driver' =&gt; 'monolog',
          'handler' =&gt; Monolog\Handler\LogglyHandler::class,
          'with' =&gt; [
              'token' =&gt; env('LOGGLY_KEY'),
              'tag' =&gt; str_replace(' ', '_', env('APP_NAME') . '_' . env('APP_ENV')),
          ]
      ]
  </code></pre>
  <p><strong>routes:</strong></p>
  <pre><code>Route::get('/', function(){
  Log::info(['foo' =&gt; 'bar']);
  return view('welcome');
  </code></pre>
  <p>});</p>
  <p><strong>from composer.json:</strong></p>
  <pre><code>&quot;laravel/framework&quot;: &quot;5.6.21&quot;,
  &quot;monolog/monolog&quot;: &quot;^1.23&quot;,
  </code></pre>
  <p>I thought maybe upgrading to a more recent monolog version might help but ran into this when trying to update monolog via composer:</p>
  <blockquote>
  <p>Your requirements could not be resolved to an installable set of packages.</p>
  <p>Problem 1</p>
  <ul>
  <li>laravel/framework v5.6.21 requires monolog/monolog ~1.12 -&gt; satisfiable by monolog/monolog[1.x-dev].</li>
  <li>laravel/framework v5.6.21 requires monolog/monolog ~1.12 -&gt; satisfiable by monolog/monolog[1.x-dev].</li>
  <li>laravel/framework v5.6.21 requires monolog/monolog ~1.12 -&gt; satisfiable by monolog/monolog[1.x-dev].</li>
  <li>Can only install one of: monolog/monolog[2.x-dev, 1.x-dev].</li>
  <li>Installation request for monolog/monolog ^2.0 -&gt; satisfiable by monolog/monolog[2.x-dev].</li>
  <li>Installation request for laravel/framework 5.6.21 -&gt; satisfiable by laravel/framework[v5.6.21].</li>
  </ul>
  </blockquote>
  <p>What am I missing? Shouldn't Monolog be sending my log output as json to Loggly? Looking atLogglyHandler it uses LogglyFormatter which extends JsonFormatter. That seems sensible but in the end the output is a string. What gives?</p>