PHP code example of anik / loguzz

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

    

anik / loguzz example snippets


$logger = new \ColinODell\PsrTestLogger\TestLogger();
$handlerStack = \GuzzleHttp\HandlerStack::create();
$options = [];
$handlerStack->push(new \Loguzz\Middleware\LogMiddleware($logger, $options), 'logger');

// Default values
$options = [
    'length' => 100,
    'log_request' => true,
    'log_response' => true,
    'success_only' => false,
    'exceptions_only' => false,
    'log_level' => 'debug',
    'request_formatter' => new \Loguzz\Formatter\RequestCurlFormatter(),
    'response_formatter' => new \Loguzz\Formatter\ResponseJsonFormatter(),
    'exception_formatter' => new \Loguzz\Formatter\ExceptionJsonFormatter(),
    'tag' => '',
    'force_json' => true,
    'separate' => false,
];