Skip to content

cbmono/laravel-log2browser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Display Laravel logs on browser console (Chrome/Firefox)

[Screenshot]

Getting Started

1. Install browser plugin


2. Add PHP class

  • Copy log2browser.php into /vendor/cbmono/laravel-log2browser/

3. Init class and define used browser

  • 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 );

4. Start logging from everywhere

# 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.


Options

/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.');

About

Display Laravel logs on browser console (Chrome/Firefox)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages