PHP code example of serendipity_hq / monolog-html-line-formatter

1. Go to this page and download the library: Download serendipity_hq/monolog-html-line-formatter 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/ */

    

serendipity_hq / monolog-html-line-formatter example snippets


// Crate a Monolog Logger
$logger = new Logger('The name of your Logger');

try {
    $handler = new TheHandlerYouChose($logFile, Logger::DEBUG);
    $handler->setFormatter(new MonologHtmlLineFormatter());
} catch(\Throwable $e) {
    throw $e;
}

// Now add some handlers
$logger->pushHandler($handler);