定制 klaravel/db-logger 二次开发

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

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

klaravel/db-logger

Composer 安装命令:

composer require klaravel/db-logger

包简介

Laravel database/sql queries logger.

README 文档

README

Build Status Total Downloads Latest Stable Version Latest Unstable Version License

This module allows you to log SQL queries (and slow SQL queries) to log file in Laravel framework. It's useful mainly when developing your application to verify whether your queries are valid and to make sure your application doesn't run too many or too slow database queries.

Installation:

  1. Run

    composer require klaravel/db-logger

    in console to install this module

  2. Open config/app.php and in providers section add:

    Klaravel\DbLogger\ServiceProvider::class,
  3. Run:

    php artisan vendor:publish --provider="Klaravel\DbLogger\ServiceProvider"

    in your console to publish default configuration files

  4. Open config/dblogger.php file and adjust settings to your need (by default it uses .env file so you can skip this step if you want).

  5. In your .env file add the following entries:

    DB_LOG_QUERIES=true  # if not needed make it false
    DB_LOG_SLOW_QUERIES=true # if not needed make it false
    DB_SLOW_QUERIES_MIN_EXEC_TIME=100
    DB_LOG_OVERRIDE=false
    DB_LOG_DIRECTORY=logs/db
    DB_CONVERT_TIME_TO_SECONDS=false
    DB_LOG_SEPARATE_ARTISAN=false
    

    and adjust values to your needs. If you have also .env.sample it's also recommended to add those entries also in .env.sample file just to make sure everyone know about those env variables. Be aware that DB_LOG_DIRECTORY is directory inside storage directory. If you want you can change it editing config/dblogger.php file.

Note:

Make sure defined DB_LOG_DIRECTORY directory should be exists default direcotry is \storage\logs\db\ else application will throw error.

统计信息

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

GitHub 信息

  • Stars: 13
  • Watchers: 4
  • Forks: 1
  • 开发语言: PHP

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固