title: Laravel logging with Monolog\Handler\BrowserConsoleHandler
body: <p>How can <strong>Laravel 5</strong>'s logging be changed to <code>Monolog\Handler\BrowserConsoleHandler</code>?</p>
  
  <p>What <strong>doesn't</strong> work in Laravel 5 but <strong>does</strong> work in a standalone PHP file:</p>
  
  <pre><code>use Illuminate\Support\Facades\Log;    
  use Monolog\Handler\BrowserConsoleHandler;
  use Monolog\Logger;
  
  // create a log channel
  $log = Log::getMonolog();
  // $log = new Logger('Testlogger'); //doesn't make any difference
  $log-&gt;pushHandler(new BrowserConsoleHandler(\Psr\Log\LogLevel::INFO));
  
  // add records to the log
  $log-&gt;addWarning('Foo');
  $log-&gt;addError('Bar');
  </code></pre>
  
  <p>All that happens is that my logs appear in the logfile but don't find their way to the browser. If I try the code in a single PHP file without framework it works, so I assume it's a Laravel problem.</p>
  
  <p>I get it working with Firebug and FirePHP installed and <code>$log-&gt;pushHandler(new FirePHPHandler());</code> instead of <code>BrowserConsoleHandler</code> but this is not a solution since it sends the logs with headers but I already sent some debug-echos when the logger wants to send the headers.<br>
  <code>BrowserConsoleHandler</code> on the other hand adds a JavaScript snippet to the end of the site that perfectly fits my needs.</p>
  
  <p>So, did anyone succeed in adding <code>BrowserConsoleHandler</code> to Laravel's logging? How?</p>