programming_cat/laravel-querylog
Composer 安装命令:
composer require programming_cat/laravel-querylog
包简介
output query log with 'querylog' channel
README 文档
README
About QueryLog
Laravel has no query log ecosystem. why?
Install
composer require programming_cat/querylog
that's all you should do.
How to use
Once you installed programming_cat/querylog your sql query would have been recorded into "storage/logs/query-yyyy-mm-dd.log".
Logging into query log
\Log::channel('querylog')->debug("QUERY!");
Configure
default values
| key | value |
|---|---|
| driver | "custom" |
| via | \programming_cat\QueryLog\Services\CreateQueryLogger::class |
| path | storage_path('logs/query.log') |
| level | debug |
| days | 30 |
| excludes | none |
if config keys are exists in config/logging.php these variables are marged with existing variables. likely..
array_merge($packaged_config_values, $existing_config_values);
logging.channels.querylog.driver
"driver" must be "custom".
logging.channels.querylog.via
"via" must be "programming_cat\QueryLog\Services\CreateQueryLogger"
logging.channels.querylog.path
define log path as you like. default variable is storage_path('logs/query.log').
logging.channels.querylog.level
log level. see monolog imprementation
logging.channels.querylog.days
set rotation days. default is 30.
logging.channels.querylog.excludes
regexp definition string or function returns boolean.
string
'excludes' => '^(insert|update) '
function
'excludes' => function (string $query) {
return strpos($query, 'exlude-table-name') !== FALSE;
}
统计信息
- 总下载量: 81
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-10-03