lukam/monolog-tap
Composer 安装命令:
composer require lukam/monolog-tap
包简介
Laravel tap for Monolog processors
README 文档
README
Processor tap enables you to easily specify Monolog processors which will add information to your log record.
Log::info('Hello world!'); // [2019-01-01 12:00:00] local.INFO: Hello world! {"memory_usage":"16 MB","uid":"e44d60c"}
Requirements
Processor tap works with Laravel versions that support the logging taps (5.6+) .
Installation
composer require lukam/monolog-tap
Usage
Simply add the provided MonologTap\MonologProcessors tap to a logging channel.
To specify the processors, add a comma-separated list of processor names as the tap attribute.
'single' => [ 'driver' => 'single', 'path' => storage_path('logs/laravel.log'), 'level' => 'debug', 'tap' => ['MonologTap\MonologProcessors:uid,memory_usage'] ],
The processor name is the snake_name of the Monolog's processor class without the processor suffix. (e.g. uid refers to the UidProcessor and memory_usage to the MemoryUsageProcessor).
Supported processors
| Processor | Description |
|---|---|
| git | Injects Git branch and Git commit SHA in all records |
| introspection | Injects line/file:class/function where the log message came from |
| memory_peak_usage | Injects memory_get_peak_usage in all records |
| memory_usage | Injects memory_get_usage in all records |
| mercurial | Injects Hg branch and Hg revision number in all records |
| process_id | Adds value of getmypid into records |
| psr_log_message | Processes a record's message according to PSR-3 rules |
| uid | Adds a unique identifier into records |
| web | Injects url/method and remote IP of the current web request in all records |
Testing
phpunit
License
The MIT License (MIT). See the license file for more information.
lukam/monolog-tap 适用场景与选型建议
lukam/monolog-tap 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 03 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 lukam/monolog-tap 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 lukam/monolog-tap 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 11
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-03-17