PHP code example of dittto / symfony-request-logger

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

    

dittto / symfony-request-logger example snippets



class TestController {
    private $client;
    private $logger;
    
    public function __construct(ClientInterface $client, RetrievableLogsInterface $logger) {
        $this->client = $client;
        $this->logger = $logger;
    }
    
    public function index()
    {
        $this->client->request('GET', 'https://api-path');
        
        var_dump($this->logger->getLogs());
    }
}