PHP code example of msschl / monolog-seq-handler

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

    

msschl / monolog-seq-handler example snippets




use Monolog\Logger;
use Msschl\Monolog\Handler\SeqHandler;

// create a log channel
$log = new Logger('channel-name');

// push the SeqHandler to the monolog logger.
$log->pushHandler(new SeqHandler('https://seq-server/'));

// add records to the log
$log->warning('Foo');
$log->error('Bar');

$log->pushHandler(new SeqHandler('https://seq-server/', 'API-KEY'));