devorto/microsoft-teams-logger 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

devorto/microsoft-teams-logger

最新稳定版本:2.0.0

Composer 安装命令:

composer require devorto/microsoft-teams-logger

包简介

Logs errors/notices etc to Microsoft Teams using Psr/LoggerInterface.

README 文档

README

Previous warning message from me: Sending message to MS Teams using their Webhook API is being deprecated by microsoft so setting up "new connectors" this way isn't possible anymore. For some projects we started switching to sending emails to teams channel because their new implementation is a pita to implement, so hereby this package is not maintained anymore.

However, Microsoft changed their mind because of lots of negative comments and the impact on killing connectors within a month, so it's still possible for coming time to use this package (extended support, so far known till december 2025). Which means I revived the package for usage, note however that you do need to update your webhook urls, and you have to look somewhere else to find the connectors, see updated setup section below.

Note: I removed the abandoned status from composer, but keep in mind that it might be better, if you have the time to look into different methods of logging to Microsoft Teams.

Microsoft Teams Logger

Send errors/notices/warnings etc to Microsoft Teams, using this Class which implements the Prs/Log/LoggerInterface.

For more information about the logger interface or log levels see their github.

Setup webhook

Before you can use this you need to setup a webhook in a Microsoft Teams channel.

  1. Goto https://teams.microsoft.com/ and select a team.
  2. Right mouse click on the desired channel and click "Manage Channel".
  3. Goto tab "settings" and unfold "Connectors" and click "Edit".
  4. Search for "Incoming Webhook" and click "configure".
  5. Provide a name and image.
  6. Click on "Create".
  7. A new field will now appear with the new webhook url in it which you can copy-paste.

Example

<?php

$logger = new \Devorto\Logger\MicrosoftTeams(
	'<paste-webhook-url-here>',
	'My Test App',
	'https://test.example.com' // Optional app url.
);

// Use one of the available log level methods:
$logger->critical('Help something went critical.');

// You can also drop an Exception in here.
$logger->critical(new Exception('Test'));

Produces this in Microsoft Teams: Example

统计信息

  • 总下载量: 1.66k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-05-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固