ngmy/laravel-query-log-tracker 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

ngmy/laravel-query-log-tracker

Composer 安装命令:

composer require ngmy/laravel-query-log-tracker

包简介

The Laravel package which log all executed queries.

README 文档

README

Latest Stable Version Total Downloads Latest Unstable Version License composer.lock
PHP CI Coverage Status

The Laravel package which log all executed queries.

Demo

Demo

Features

Laravel Query Log Tracker has the following features:

  • Log all executed queries with the following items:
    • SQL with bound parameters
    • Bind parameters
    • Execution time in milliseconds
    • Connection name
  • Disable/Enable query logging at runtime
  • More configurations:
    • Log level
    • Exclude patterns
    • Channels

Requirements

Laravel Query Log Tracker has the following requirements:

  • PHP >= 7.3
  • Laravel >= 6.0

Installation

Execute the Composer require command:

composer require ngmy/laravel-query-log-tracker

This will update your composer.json file and install this package into the vendor directory.

If you don't use package discovery, add the service provider to the providers array in the config/app.php file:

Ngmy\LaravelQueryLogTracker\QueryLogTrackerServiceProvider::class,

If you don't use package discovery, add the alias to the aliases array in the config/app.php file:

'QueryLogTracker' => Ngmy\LaravelQueryLogTracker\QueryLogTrackerFacade::class,

Publishing Configuration

Execute the Artisan vendor:publish command:

php artisan vendor:publish

This will publish the configuration file to the config/ngmy-query-log-tracker.php file.

You can also use the tag to execute the command:

php artisan vendor:publish --tag=ngmy-query-log-tracker

You can also use the service provider to execute the command:

php artisan vendor:publish --provider="Ngmy\LaravelQueryLogTracker\QueryLogTrackerServiceProvider"

Usage

Log Queries

Execute queries with Laravel. That's all.

Disable Log

There are two ways to disable log.

QueryLogTracker::beginDisable();
// Execute queries for which you want to disable log
QueryLogTracker::endDisable();
QueryLogTracker::disable(function () {
    // Execute queries for which you want to disable log
});

统计信息

  • 总下载量: 936
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 8
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-03-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固