PHP code example of struggle-for-php / sfp-stubs-psr-log

1. Go to this page and download the library: Download struggle-for-php/sfp-stubs-psr-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/ */

    

struggle-for-php / sfp-stubs-psr-log example snippets



/** @var Psr\Log\LoggerInterface $logger */
$logger->error('error happen.', ['exception' => $exception->getMessage()]);

/**
 * @param LogLevel::*  $level
 */
public function log($level, $message, array $context = array())

Parameter #2 $context of method Psr\Log\LoggerInterface::error() expects array()|array('exception' => Exception),