mosaxiv/cakephp-format-query-logger

FormatQueryLogger plugin for CakePHP

0.0.2 2018-10-15 16:28 UTC

This package is auto-updated.

Last update: 2021-03-23 00:39:52 UTC


README

Format the query log.

😨

image2.png

😄

image.png

Requirements

  • CakePHP3.5.0+

Installation

composer require mosaxiv/cakephp-format-query-logger

Usage

Console Log

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

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

File Log

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);