ibrand / laravel-database-logger
ibrand laravel database logger
Installs: 15 579
Dependents: 0
Suggesters: 0
Security: 0
Stars: 29
Watchers: 3
Forks: 2
Open Issues: 0
Requires
- php: >=5.6
Requires (Dev)
- orchestra/database: ~3.5
- orchestra/testbench: ~3.5
- phpunit/phpunit: ~6.0
README
A simple database logger for Laravel application, support Guard,Auth to multiple file record.
Feature
- Log files support anonymous or guard types.
- Record auth uesrs.
- Record request url
- Support record specifying SQL statement(SELECT,INSET INTO,UPDATE,DELETE,ALTER TABLE etc.)
- Record slow logs separately.
Installation
composer require ibrand/laravel-database-logger:~1.0 -vvv
Below Laravel5.5 version
In config/app.php
'providers' region add
iBrand\DatabaseLogger\ServiceProvider::class
Publish config file.
php artisan vendor:publish --provider="iBrand\DatabaseLogger\ServiceProvider"
Usage
Enable in .env or config file.
Set log_queries=>true
in config/ibrand/dblogger.php
file. or set DB_LOG_QUERIES = true
in .env
file.
use databaselogger
middleware
Route::get('test', 'Controller@index')->middleware('databaselogger');
For more middleware users see the document.
Preview
Contributing
If you find any bug or problem please raise the issue here.