freshbitsweb/laravel-log-enhancer
Composer 安装命令:
composer require freshbitsweb/laravel-log-enhancer
包简介
Make debugging easier by adding more data to your laravel logs
README 文档
README
Laravel Log Enhancer (Laravel 5.6 to Laravel 13.x)
Laravel logs help all of us debug issues. We value them the most in production. But, the contextual data of the request is not logged by default. We need more than just stack trace to debug the issue easily. The things like request URL, request input data, session data, etc. help us hunt down the exact cause quickly. That's what this plug-and-play Laravel package does for you :)
Before
After
Requirements
| PHP | Laravel | Package |
|---|---|---|
| 8.3+ | 13.x | v2.1.0 |
| 8.2+ | 12.x | v2.0.0 |
| 8.2+ | 11.x | v1.7.0 |
| 8.1+ | 10.x | v1.6.0 |
| 8.0+ | 9.x | v1.5.0 |
| 8.0+ | 9.x | v1.4.0 |
| 7.3+ | 8.x | v1.3.0 |
| 7.2.5+ | 7.x | v1.2.0 |
| <7.2.5 | 6.x | v1.1.0 |
| <7.1 | 5.x | v1.0.* |
Notes:
- For Laravel 5.5, you may use Slack Error Notifier package.
Installation
- Install the package by running this command in your terminal/cmd:
composer require freshbitsweb/laravel-log-enhancer
- Add this package's LogEnhancer class to the tap option of your log channel in config/logging.php:
'production_stack' => [
'driver' => 'stack',
'tap' => [Freshbitsweb\LaravelLogEnhancer\LogEnhancer::class],
'channels' => ['daily', 'slack'],
],
Optionally, you can import config file by running this command in your terminal/cmd:
php artisan vendor:publish --tag=laravel-log-enhancer-config
It has following configuration settings:
-
(bool) log_request_details => Set to true if you wish to log request data. Reference
-
(bool) log_input_data => Set to true if you wish to log user input data
-
(bool) log_request_headers => Set to true if you wish to log request headers
-
(bool) log_session_data => Set to true if you wish to log session data
-
(bool) log_memory_usage => Set to true if you wish to log memory usage Reference
-
(bool) log_git_data => Set to true if you wish to log git branch name, last commit message, last commit id, staged or (un)staged changes.
-
(bool) log_app_details => Set to true if you wish to log application data. It will include Laravel Version, PHP Version, Config Cached and Route Cached details.
-
(array) ignore_input_fields => If input data is being sent, you can specify the inputs from the user that should not be logged. for example, password,cc number, etc.
Lumen compatibility
We do not use Lumen in any of our projects. And this package is not tested with Lumen framework. If you are willing to use this package with Lumen, please help us by testing and making a PR to make it work. Thanks.
Authors
- Gaurav Makhecha - Initial work
See also the list of contributors who participated in this project.
License
This project is licensed under the MIT License - see the LICENSE file for details
Treeware
You're free to use this package, but if it makes it to your production environment I would highly appreciate you buying the world a tree.
It’s now common knowledge that one of the best tools to tackle the climate crisis and keep our temperatures from rising above 1.5C is to plant trees. If you contribute to our forest you’ll be creating employment for local families and restoring wildlife habitats.
You can buy trees at for our forest here offset.earth/treeware
Read more about Treeware at treeware.earth
Special Thanks to
- Laravel Community
freshbitsweb/laravel-log-enhancer 适用场景与选型建议
freshbitsweb/laravel-log-enhancer 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 603.92k 次下载、GitHub Stars 达 346, 最近一次更新时间为 2018 年 03 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 freshbitsweb/laravel-log-enhancer 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 freshbitsweb/laravel-log-enhancer 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 603.92k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 346
- 点击次数: 31
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-03-27

