PHP code example of leovince / monolog-teams

1. Go to this page and download the library: Download leovince/monolog-teams 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/ */

    

leovince / monolog-teams example snippets


use LeoVince\MonologTeams\TeamsHandler;
use Monolog\Level;
use Monolog\Logger;

// Create the logger
$log = new Logger('my_logger');
$log->pushHandler(new TeamsHandler('LOG_TEAMS_WEBHOOK_URL', 'APP_NAME', level: Level::Error));

// Use the logger
$log->error('Error message');

'teams' => [
    'driver'  => 'monolog',
    'handler' => LeoVince\MonologTeams\TeamsHandler::class,
    'level' => env('LOG_LEVEL', 'error'),
    'handler_with' => [
        'webhookUrl' => env('LOG_TEAMS_WEBHOOK_URL'),
        'name' => env('APP_NAME', 'Laravel'),
        '