PHP code example of jidaikobo / log

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

    

jidaikobo / log example snippets


use Jidaikobo\Log;
Log::init('/path/to/log.log', 5 * 1024 * 1024); // 5MB max file size

Log::info('This is an informational message.');
Log::warning('This is a warning message.');
Log::error('An error occurred.');
Log::debug('Debugging details.');

Log::write(['foo', 'bar', 'baz']);

Log::getInstance()->registerHandlers();