huang-yi / laravel-db-log
Logs database queries for Laravel.
1.6.1
2018-06-11 09:33 UTC
Requires
- illuminate/database: ~5.6
- illuminate/http: ~5.6
- illuminate/log: ~5.6
- illuminate/support: ~5.6
Requires (Dev)
- phpunit/phpunit: ~6.0
README
This package logs your database queries.
Version Compatibility
Installation
$ composer require huang-yi/laravel-db-log:1.6.*
Usage
Add this configuration to your application's .env
file:
DB_LOG=true
Configuration
In general, developers do not need to modify any configurations.
If you don't want to keep the default configurations, just copy the following options into the config/logging.php
file:
<?php return [ 'channels' => [ 'db' => [ 'debug' => env('DB_LOG', false), 'name' => env('DB_LOG_NAME', 'sql'), 'driver' => env('DB_LOG_DRIVER', 'daily'), 'path' => storage_path('logs/sql.log'), 'level' => env('DB_LOG_LEVEL', 'debug'), 'days' => env('DB_LOG_MAX_FILES', 2), ], ], ];
Chinese Doc
License
The Laravel DB Log package is open-sourced software licensed under the MIT license.