PHP code example of paulgsepulveda / monolog-teams-workflow

1. Go to this page and download the library: Download paulgsepulveda/monolog-teams-workflow library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

paulgsepulveda / monolog-teams-workflow example snippets


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

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

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

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

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