Download the PHP package bkwld/reporter without Composer
On this page you can find all versions of the php package bkwld/reporter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bkwld/reporter
More information about bkwld/reporter
Files in bkwld/reporter
Package reporter
Short Description Generate styled logs of Laravel 4 requests that include application timing, memory usage, input data, and sql queries
License MIT
Informations about the package reporter
Reporter
Reporter is a package for Laravel 5 (versions 3.x) and Laravel 4 (versions 2.x) that brings back functionality found in the profiler of Laravel 3. Instead of displaying output in the browser, it writes to the disk in a log file that you can watch in realtime with tail -f
or an app like Mac's Console. This adds some advantages over a browser based profiler:
- You can inspect AJAX requests
- POST variables are logged
- The output rendering isn't affected by your application's CSS or JS
- You can inspect apps that are in a production environment
The output looks like:
Or, if you have style turned on:
Reporter also adds the ability to time blocks of code (as displayed in the examples "TIMERS" line).
Installation
- Add Reporter to composer.json:
"bkwld/reporter": "~3.0",
and do a composer install. - Add
'Bkwld\Reporter\ServiceProvider',
to your app/config/app.php's providers array. - If you plan to use timers, add
'Timer' => 'Bkwld\Reporter\Facades\Timer',
to the app/config/app.php's aliases array.
Config
enable
- If false, Reporter will do nothing. By default, this is set to false for the "production" enviornment IF you publish the package's config file to your app/config directory.style
- Add color and style codes for output in a Terminal.error_log
- If true, also write logs to the PHPerror_log()
levels
- An array of log levels that should be shownignore
- A regex string. If the request path matches, no log will be written.
Usage
Logging
Reporter writes it's log to app/storage/logs/reporter.log. I'd recommend running tail -f storage/logs/reporter.log
from your project directory to follow it.
Timer
Laravel 3 had a way to time events with it's profiler. Reporter re-introduces this.
Timer::start('example');
// Some code that you are benchmarking
Timer::stop('example');
Start() and stop() take a string as their argument that is used to match up the start and stop calls. It is also displayed as the key for the timer in the log. The above example would add lines like this to the log:
TIMERS:
example: 20.02ms