PHP code example of joefallon / phplog

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

    

joefallon / phplog example snippets


__construct($filePath, $level)
emergency($message, array $context = array())
alert($message, array $context = array())
critical($message, array $context = array())
error($message, array $context = array())
warning($message, array $context = array())
notice($message, array $context = array())
info($message, array $context = array())
debug($message, array $context = array())
log($level, $message, array $context = array())

$logger = new Log('/tests/logs/' . date('Y-m-d') . '.log', Log::DEBUG);
$logger->debug('Test debug.', array('contextKey' => 'contextVal'));