2

I've added FirePHPCore to my composer.js dependencies and pulled them down, and installed the FirePHP Chrome plugin, but I still can't seem to log to Chrome's console. I've only just started using Laravel and Composer, where previously I was using CodeIgniter and adding FirePHP as a third-party library. What else do you have to do to set up FirePHPCore in Laravel 4? Do I add it to autoload in Composer.json?

mtpultz
  • 17,267
  • 22
  • 122
  • 201

1 Answers1

1

Laravel uses Monolog to handle all its logging so you should probably investigate enabling the FirePHPHandler for it in your bootstrap (somewhere like app/filters.php).

App::before(function($request)
{
    // Get an instance of Monolog
    $monolog = Log::getMonolog();
    // Choose FirePHP as the log handler
    $monolog->pushHandler(new \Monolog\Handler\FirePHPHandler());
});

You can then log to it manually like this:

Log::info('info message');
Log::warning('warning message');
Log::error('error message');

Extra reading:

Tom
  • 3,031
  • 1
  • 25
  • 33