cmdisp/monolog-microsoft-teams
最新稳定版本:2.0.1
Composer 安装命令:
composer require cmdisp/monolog-microsoft-teams
包简介
Monolog Handler for sending messages to Microsoft Teams using the Incoming Webhook connector
README 文档
README
This package depends on the Office 365 connectors within Microsoft Teams. Microsoft has announced that they are retiring the Office 365 connectors as of 15 August 2024. All connectors will stop working on 1 October 2024. Microsoft recommends Power Automate workflows as the solution for sending information to Teams. This new workflow format is not backward compatible.
As a result, there is no viable path for us to continue to maintain this package beyond this point. It is therefore deprecated as of July 2024.
monolog-microsoft-teams
Monolog Handler for sending messages to Microsoft Teams channels using the Incoming WebHook connector.
Install
$ composer require cmdisp/monolog-microsoft-teams
Usage
$logger = new \Monolog\Logger('app'); $logger->pushHandler(new \CMDISP\MonologMicrosoftTeams\TeamsLogHandler('INCOMING_WEBHOOK_URL', \Monolog\Level::Error)); $logger->error('Error message');
Usage with Laravel/Lumen framework (5.6+)
Create a custom channel
config/logging.php
'teams' => [ 'driver' => 'custom', 'via' => \CMDISP\MonologMicrosoftTeams\TeamsLogChannel::class, 'level' => 'error', 'url' => 'INCOMING_WEBHOOK_URL', ],
Send an error message to the teams channel:
Log::channel('teams')->error('Error message');
You can also add teams to the default stack channel so all errors are automatically send to the teams channel.
'channels' => [ 'stack' => [ 'driver' => 'stack', 'channels' => ['single', 'teams'], ], ],
Unit testing · PhpUnit
The tests require a valid Teams Incoming Webhook URL. To provide this URL to PhpUnit, copy phpunit.xml.dist to phpunit.xmland set the URL in the <php> section. Make sure to not commit your local phpunit.xml into the repo!
<php> <env name="TEAMS_INCOMING_WEBHOOK_URL" value="https://outlook.office.com/webhook/..." /> </php>
Run the tests on the command line:
$ composer test
License
monolog-microsoft-teams is available under the MIT license. See the LICENSE file for more info.
cmdisp/monolog-microsoft-teams 适用场景与选型建议
cmdisp/monolog-microsoft-teams 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 811.11k 次下载、GitHub Stars 达 51, 最近一次更新时间为 2026 年 01 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 cmdisp/monolog-microsoft-teams 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 cmdisp/monolog-microsoft-teams 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 811.11k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 51
- 点击次数: 24
- 依赖项目数: 2
- 推荐数: 2
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-04