Looking to hire Laravel developers? Try LaraJobs

laravel-microsoft-teams-logger maintained by samirraihan

Description
Laravel logger that sends logs to Microsoft Teams via webhook.
Last update
2025/05/29 10:51 (dev-main)
License
Links
Downloads
9

Comments
comments powered by Disqus

Samir Raihan Laravel Microsoft Teams Logger

A Laravel-compatible logger that sends messages to a Microsoft Teams webhook using Monolog.

Installation

composer require samirraihan/laravel-microsoft-teams-logger

Laravel Integration

Publish Configuration File

php artisan vendor:publish --tag=config

Set Environment Variables

TEAMS_WEBHOOK_URL=
TEAMS_LOG_LEVEL=error

Add Custom Logging Channel (config/logging.php -> channels)

'stack' => [
    'driver' => 'stack',
    'channels' => ['single', 'teams'],
    'ignore_exceptions' => false,
],

'teams' => [
    'driver' => 'custom',
    'via' => MicrosoftTeamsLogger\TeamsLoggerFactory::class,
    'level' => env('TEAMS_LOG_LEVEL', 'error'),
    'webhookUrl' => env('TEAMS_WEBHOOK_URL'),
],