PHP code example of aqilix / zf3-psr3-logger

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

    

aqilix / zf3-psr3-logger example snippets


public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
{
    $example = new Example();
    $example->setLogger($container->get("psr3_logger"));
    return $example;
}

class Example
{
    use Psr\Log\LoggerAwareTrait;

    public function test()
    {
        $this->logger->log(\Psr\Log\LogLevel::INFO, "{function} Testing logger", ["function" => __FUNCTION__]);
        $this->logger->log(\Psr\Log\LogLevel::ERROR, "{function} Testing logger", ["function" => __FUNCTION__]);
    }
}