PHP code example of koded / logging

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

    

koded / logging example snippets




$settings = [
    [
        ['class' => Cli::class, 'levels' => Log::ERROR],
        ['class' => File::class, 'levels' => Log::INFO]
    ]
];

$log = new Log(...$settings);

// This message is processed by Cli and File
$log->alert('The message with {variable}', ['variable' => 'useful info']);

// This message won't be processed by Cli 
// because it's level is below ERROR,
// but File will handle it
$log->warning("You don't see anything");



[..., ['levels' => Log::WARN | Log::INFO | Log::ERROR, ...]],