定制 programming_cat/laravel-querylog 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

programming_cat/laravel-querylog

Composer 安装命令:

composer require programming_cat/laravel-querylog

包简介

output query log with 'querylog' channel

README 文档

README

Packagist Stable Version Packagist downloads MIT Software License

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-10-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固