PHPackages                             paulgsepulveda/monolog-teams-workflow - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. paulgsepulveda/monolog-teams-workflow

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

paulgsepulveda/monolog-teams-workflow
=====================================

Monolog Handler for sending messages to Microsoft Teams channels using the Workflow webhook

v1.0.0(1y ago)01.4k1[1 PRs](https://github.com/paulgsepulveda/monolog-teams-workflow/pulls)MITPHPPHP ^8.2

Since Jul 16Pushed 1y ago2 watchersCompare

[ Source](https://github.com/paulgsepulveda/monolog-teams-workflow)[ Packagist](https://packagist.org/packages/paulgsepulveda/monolog-teams-workflow)[ RSS](/packages/paulgsepulveda-monolog-teams-workflow/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

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](https://github.com/cmdisp/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
-------

[](#install)

```
$ composer require Metamorfer/monolog-teams-workflow
```

Configuring Workflow
--------------------

[](#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)

```
$logger = new \Monolog\Logger('app');
$logger->pushHandler(new \Metamorfer\MonologTeamsWorkflow\TeamsWorkflowLogHandler('INCOMING_WEBHOOK_URL', \Monolog\Level::Error));

$logger->error('Error message');
```

Usage with Laravel/Lumen framework (5.6+)
-----------------------------------------

[](#usage-with-laravellumen-framework-56)

Create a [custom channel](https://laravel.com/docs/master/logging#creating-custom-channels)

`config/logging.php`

```
'teams' => [
    'driver' => 'custom',
    'via' => \Metamorfer\MonologTeamsWorkflow\TeamsLogChannel::class,
    'level' => 'error',
    'url' => 'INCOMING_WEBHOOK_URL',
    'source_name' => env('APP_NAME'),
    'source_url' => env('APP_URL'),
],
```

`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:

```
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
----------------------

[](#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 `` section. Make sure to not commit your local *phpunit.xml* into the repo!

```

```

Run the tests on the command line:

```
$ composer test
```

License
-------

[](#license)

monolog-teams-workflow is available under the MIT license. See the LICENSE file for more info.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 86.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

718d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7047809?v=4)[Paul Sepulveda](/maintainers/paulgsepulveda)[@paulgsepulveda](https://github.com/paulgsepulveda)

---

Top Contributors

[![paulgsepulveda](https://avatars.githubusercontent.com/u/7047809?v=4)](https://github.com/paulgsepulveda "paulgsepulveda (13 commits)")[![Metamorfer](https://avatars.githubusercontent.com/u/6829740?v=4)](https://github.com/Metamorfer "Metamorfer (2 commits)")

---

Tags

monolog-handler

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/paulgsepulveda-monolog-teams-workflow/health.svg)

```
[![Health](https://phpackages.com/badges/paulgsepulveda-monolog-teams-workflow/health.svg)](https://phpackages.com/packages/paulgsepulveda-monolog-teams-workflow)
```

###  Alternatives

[symfony/monolog-bridge

Provides integration for Monolog with various Symfony components

2.6k203.8M358](/packages/symfony-monolog-bridge)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[illuminate/log

The Illuminate Log package.

6225.3M623](/packages/illuminate-log)[spatie/flare-client-php

Send PHP errors to Flare

177161.5M23](/packages/spatie-flare-client-php)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[graycore/magento2-stdlogging

A Magento 2 module that changes all logging handlers to stdout

2587.9k](/packages/graycore-magento2-stdlogging)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
