- Chrome: http://craig.is/writing/chrome-logger
- Firefox: http://www.firephp.org/
- Copy
log2browser.php
into/vendor/cbmono/laravel-log2browser/
- Add this code into
/app/start/local/.php
require_once base_path() . '/vendor/cbmono/laravel-log2browser/log2browser.php';
$myBrowser = 'chrome'; # Or 'fire' for Firefox
Log2Browser::init( $myBrowser );
# Example:
$testData = array('var1' => 'Hello world!', 'var2' => array('foo' => 'bar'));
Log2Browser::error('Error', $testData);
# Or use the shortcut
LogB::log('Error', $testData);
Note: I'm using Laravel Environment Configuration and restricting this functionality only to my local machine.
/vendor/cbmono/laravel-log2browser/log2browser.php
is just extending the default Laravel Log function. Therefor, you still have all the main functionalities including those from Monolog:
# Example:
LogB::info('This is some useful information.');
LogB::warning('Something could be going wrong.');
LogB::error('Something is really going wrong.');