PHP code example of mosaxiv / cakephp-format-query-logger

1. Go to this page and download the library: Download mosaxiv/cakephp-format-query-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/ */

    

mosaxiv / cakephp-format-query-logger example snippets


use Cake\Datasource\ConnectionManager;
use mosaxiv\Log\FormatQueryLogger;

$con = ConnectionManager::get('default');
FormatQueryLogger::console($con);

use Cake\Datasource\ConnectionManager;
use mosaxiv\Log\FormatQueryLogger;
use Cake\Log\Log;

Log::config('queries', [
    'className' => 'File',
    'path' => LOGS,
    'file' => 'queries.log',
    'scopes' => ['queriesLog']
]);
$con = ConnectionManager::get('default');
FormatQueryLogger::new($con);