cbytedigital/laravel-teams-logger

Laravel package to log exceptions to a Microsoft Teams channel using Microsoft Teams Webhooks.
6,998 3
Install
composer require cbytedigital/laravel-teams-logger
Latest Version:v2.0.0
PHP:^8.0
License:MIT
Last Updated:Aug 3, 2026
Links: GitHub  ·  Packagist
Maintainer: cbytedigital

Laravel Teams Logger

PHP from Packagist Latest Version on Packagist Software License Total Downloads

A Laravel package which can be used for log handling through laravel logging using the Microsoft teams webhook.

Installation

Use composer to install this package:

$ composer require cbytedigital/laravel-teams-logger

Usage

After installing the package through composer, we need to edit the logging. We have to add a teams channel with the following information. (The channel name can be whatever you want, just match it with the channel entered in the array of the stack channel)

'channels' => [
    'stack' => [
        'driver' => 'stack',
        'channels' => ['single', 'teams' /** This is important for the channel to register properly */],
        'ignore_exceptions' => false,
    ],
    
    ...
    
    'teams' => [
        'driver' => 'custom',
        'via' => \CbyteDigital\TeamsLogger\Logging\TeamsLoggingChannel::class,
        'type' => \CbyteDigital\TeamsLogger\Enums\LogType::EXCEPTION,
        'level' => 'error',
        'url' => env('TEAMS_WEBHOOK_URL') /** This is the webhook URL generated by Teams */,
        'name' => 'Project name',
    ],
]

How to get a Webhook URL in Microsoft Teams

Create a channel inside Microsoft Teams and open the channel. In the top right corner of the channel, you will see three dots. If you click there, you will have to go to Connectors.

Here you will install the connector 'Incoming Webhook'. Next you can configure this for each project. Enter a name and icon and click on 'create'. This will generate a URL which we need for this package to work.

Testing

Run the tests with:

$ composer test

Support

Version Laravel Version PHP Version
1.x >= 8.x >=8.0

Reviewware

This package is completely free to use. If it makes it to your production environment, we'd love it if you left us a Google review! ⭐

You can find us here: Google review CBYTE

License

The MIT License (MIT). Please see License File for more information.

Related Packages

gabrieloliverio/laravel5-generators

Database metadata-based generators for Laravel 5

1
erirk/paypalpayment

laravel-paypalpayment is simple package help you process direct credit card paym...

0
doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

631,580,251 9,707
laravel/framework

The Laravel Framework.

580,311,802 34,925
laravel/tinker

Powerful REPL for the Laravel framework.

489,754,436 7,444