mitoop / laravel-query-logger
v1.0.2
2024-05-27 07:57 UTC
Requires
- illuminate/support: ^6|^7|^8|^9|^10|^11
README
🍎 记录 SQL 执行日志
安装
composer require --dev mitoop/laravel-query-logger
配置
在 config/logging.php
新增配置
<?php return [ 'channels' => [ ... 'sql' => [ 'driver' => 'daily', 'path' => storage_path('logs/sql.log'), 'level' => env('LOG_LEVEL', 'debug'), 'permission' => 0664, ], ], // 新增 query 'query' => [ // 是否开启记录 'enabled' => env('ENABLE_QUERY_LOG', false), // 记录的频道 'channel' => 'sql' ] ];