PHP code example of timrutte / laminas-log-processor-environment

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

    

timrutte / laminas-log-processor-environment example snippets


$logger = new \Laminas\Log\Logger();
$logger->addProcessor(new \TimRutte\Laminas\Log\Processor\Environment());
$writer = new \Laminas\Log\Writer\Stream();
$formatter = new \Laminas\Log\Formatter\Json();
$writer->setFormatter($formatter);
$logger->addWriter($writer);