wcg-package/eloquent-event-logger
Composer 安装命令:
composer require wcg-package/eloquent-event-logger
包简介
Eloquent Event Logger is a logging tool for Laravel's Eloquent ORM. It's designed to automatically record and log events for Laravel Eloquent model's operations such as creation, updates and deletions. Detailed event logs help facilitate debugging and keep track of changes made to models over time.
README 文档
README
Eloquent Event Logger is a logging tool for Laravel's Eloquent ORM. It automatically records and logs events for Laravel Eloquent model operations such as creation, updates, and deletions. Detailed event logs help facilitate debugging and keep track of changes made to models over time. It's a tool for monitoring your application's data layer, ensuring data integrity, and aiding in development.
Installation
Install the package via Composer:
composer require wcg-package/eloquent-event-logger
Configuration
Once the package is installed, Laravel's service provider should be automatically registered. If not, you can manually register the service provider in your config/app.php file:
'providers' => [ // Other providers... WcgPackage\EloquentEventLogger\EloquentEventServiceProvider::class, ],
Usage
The package automatically logs events for Eloquent models in the "Models" directory. It logs updates, creations, and deletions, providing detailed information about the changes made to the models.
Logging Events
The following events are logged:
- Model Updates: Logs the old and new values of the updated model.
- Model Creations: Logs the details of the model being created.
- Model Deletions: Logs when a model is being deleted.
Log File Location
Logs are stored in the storage/logs directory, organized by date and model name.
Logging Levels
Logs are created with different levels based on the type of event:
- INFO: Model updates, creations, and deletions.
- ERROR: Errors that occur during the logging process.
Customization
You can customize the logging behavior by extending the EloquentEventServiceProvider class and overriding its methods.
License
This package is open-sourced software licensed under the MIT license.
Note: Ensure that your application is set up to handle logging according to your needs, especially in production environments.
wcg-package/eloquent-event-logger 适用场景与选型建议
wcg-package/eloquent-event-logger 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 12 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 12 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 wcg-package/eloquent-event-logger 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 wcg-package/eloquent-event-logger 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-12-19