Download the PHP package paulgsepulveda/monolog-teams-workflow without Composer
On this page you can find all versions of the php package paulgsepulveda/monolog-teams-workflow. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download paulgsepulveda/monolog-teams-workflow
More information about paulgsepulveda/monolog-teams-workflow
Files in paulgsepulveda/monolog-teams-workflow
Package monolog-teams-workflow
Short Description Monolog Handler for sending messages to Microsoft Teams channels using the Workflow webhook
License MIT
Informations about the package monolog-teams-workflow
monolog-teams-workflow
Monolog Handler for sending messages to Microsoft Teams channels using Workflow / Power Automate. I put this together based on monolog-microsoft-teams after Microsoft retired Office 365 connectors.
This is a fork of the original paulgsepulveda/monolog-teams-workflow repository making it available for PHP version 8.1
Install
Configuring Workflow
- Install the app
Power Automate
on the Teams channel that is intended to receive the log messages - Create a new Workflow using the template Post to a channel when a webhook request is received.
- The JSON formatting assumes that the Select an output from previous steps field will remain set to
attachments
- The JSON formatting assumes that the Adaptive Card field under Post your own adaptive card will remain set to
content
- After saving the workflow, the When a Teams webhook request is received card will provide the
HTTP POST URL
value to use for the incoming webhook.
Usage
Usage with Laravel/Lumen framework (5.6+)
Create a custom channel
config/logging.php
source_name
and source_url
are included since the receiving channel may be receiving notifications from more than one site.
Send an error message to the teams channel:
You can also add teams
to the default stack
channel so all errors are automatically send to the teams
channel.
Unit testing · PhpUnit
The tests require a valid incoming Workflow webhook url. Follow the steps above in Configuring Workflow to generate this. To provide this URL to PhpUnit, copy phpunit.xml.dist
to phpunit.xml
and set the URL in the <php>
section. Make sure to not commit your local phpunit.xml into the repo!
Run the tests on the command line:
License
monolog-teams-workflow is available under the MIT license. See the LICENSE file for more info.