PHP code example of dankkomcg / composite-logger

1. Go to this page and download the library: Download dankkomcg/composite-logger 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/ */

    

dankkomcg / composite-logger example snippets




ankkomcg\Logger\Types\Console\LightColourConsoleLogger;
use Dankkomcg\Logger\Types\File\MonologFileLogger;
use Dankkomcg\Logger\Composite\SimpleCompositeLogger;

$consoleLogger = new LightColourConsoleLogger(['info' => 'blue']);
$fileLogger = new MonologFileLogger(dirname(__FILE__) . '/app.log', 'app');

$compositeLogger = new SimpleCompositeLogger([$consoleLogger, $fileLogger]);

$compositeLogger->info('This message will be logged to both the console and the file.');