Skip to content

Laravel handler to sending messages to Microsoft Teams using the Incoming Webhook connector.

License

Notifications You must be signed in to change notification settings

ansjabar/laravel-teams-logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

laravel-teams-logger

Laravel handler to log errors to Microsoft Teams using Incoming Webhook connector.

Installation

Require this package with composer.

$ composer require ansjabar/laravel-teams-logger

Integration

$ php artisan vendor:publish --provider="AnsJabar\LaravelTeamsLogger\LoggerServiceProvider"

Add this configuration to config/logging.php file

'teams' => [
    'driver'    => 'custom',
    'via'       => \AnsJabar\LaravelTeamsLogger\LoggerChannel::class,
    'level'     => 'debug',
    'url'       => env('TEAMS_LOGGING_URL'),
    'name'      => 'The Project' // Optional: 
],

After added configs to your config/logging.php file, add TEAMS_LOGGING_URL variable to your .env file with connector url from your microsoft teams connector. Please read microsoft teams document to find your connector url.

Usage

To send a simple error message to teams channel, you can use script below:

Log::channel('teams')->error('Error message');

To log all you application errors automatically, add teams to the default stack channel

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

License

This laravel-teams-logger package is available under the MIT license. See the LICENSE file for more info.

About

Laravel handler to sending messages to Microsoft Teams using the Incoming Webhook connector.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages