Download the PHP package yesccx/laravel-database-logger without Composer
On this page you can find all versions of the php package yesccx/laravel-database-logger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download yesccx/laravel-database-logger
More information about yesccx/laravel-database-logger
Files in yesccx/laravel-database-logger
Download yesccx/laravel-database-logger
More information about yesccx/laravel-database-logger
Files in yesccx/laravel-database-logger
Vendor yesccx
Package laravel-database-logger
Short Description record database execute logs
License MIT
Package laravel-database-logger
Short Description record database execute logs
License MIT
Please rate this library. Is it a good library?
Informations about the package laravel-database-logger
Database-Logger
记录数据库MySQL、Mongo等执行日志,支持多数Laravel版本
目录
- 目录
- 功能特点
- 运行环境
- 开始使用
- 1. 安装
- 2. 初始化
- 3. 配置
- 4. 使用
- API
- 临时禁用日志记录
- 自定义记录器
- 功能清单
- License
功能特点
- 支持多数Laravel版本:
Laravel 5+
、Laravel 6+
、Laravel 7+
、Laravel 8+
、Laravel 9+
- 支持
MongoDB
、MySQL
产生的执行日志 - 可选日志存储驱动
file
、mysql
,并支持自定义扩展 - 更多API支持
运行环境
PHP版本 |
---|
PHP >= 7.0 |
Laravel版本 | 包版本 | 支持状态 |
---|---|---|
9.x | 1.0.x | 支持 |
8.x | 1.0.x | 支持 |
7.x | 1.0.x | 支持 |
6.x | 1.0.x | 支持 |
5.8.x | 1.0.x | 支持 |
5.7.x | 1.0.x | 支持 |
5.6.x | 1.0.x | 支持 |
开始使用
1. 安装
2. 初始化
发布配置文件,ServiceProvider等。
如果需要将日志记录到数据表中,还需要提前初始化对应的日志记录表
。
3. 配置
从env
配置中开启记录器,并指定记录器的驱动。
PS: 如果以数据库驱动,需要先准备好数据表。在初始化时执行相关的迁移文件即可
4. 使用
- 以
file
驱动时日志内容会存储至storage/logs/dl_sql-*.log
文件中; - 以
mysql
驱动时,日志内容会存储至database_logs
数据表中。
API
临时禁用日志记录
如果想在某些情况下临时禁用日志记录功能,可以执行以下操作:
自定义记录器
当需要将日志内容以别的方式记录时,可以通过自定义记录器实现
1. 定义记录器:
2. 使用自定义记录器:
功能清单
记录数据日志可选数据日志记录的存储驱动(file、mysql)赋于查询时可禁用日志记录功能- 赋于模型查询时直接打印SQL语句
- 日志记录事件
- 可视化面板查看日志
- 补充更多API
- 单元测试
License
MIT
All versions of laravel-database-logger with dependencies
PHP Build Version
Package Version
The package yesccx/laravel-database-logger contains the following files
Loading the files please wait ....