PHP Class DebugKit\Database\Log\DebugLog

This logger decorates the existing logger if it exists, and stores log messages internally so they can be displayed or stored for future use.
Inheritance: extends Cake\Database\Log\QueryLogger
Datei anzeigen Open project: cakephp/debug_kit Class Usage Examples

Protected Properties

Property Type Description
$_connectionName string Name of the connection being logged.
$_logger Cake\Database\Log\LoggedQuery Decorated logger.
$_queries array Logs from the current request.
$_totalRows integer Total rows of all queries
$_totalTime integer Total time (ms) of all queries

Public Methods

Method Description
__construct ( Cake\Database\Log\QueryLogger $logger, string $name ) Constructor
log ( Cake\Database\Log\LoggedQuery $query ) : void Log queries
name ( ) : array Get the stored logs.
queries ( ) : array Get the stored logs.
totalRows ( ) : integer Get the total rows
totalTime ( ) : integer Get the total time

Method Details

__construct() public method

Constructor
public __construct ( Cake\Database\Log\QueryLogger $logger, string $name )
$logger Cake\Database\Log\QueryLogger The logger to decorate and spy on.
$name string The name of the connection being logged.

log() public method

Log queries
public log ( Cake\Database\Log\LoggedQuery $query ) : void
$query Cake\Database\Log\LoggedQuery The query being logged.
return void

name() public method

Get the stored logs.
public name ( ) : array
return array

queries() public method

Get the stored logs.
public queries ( ) : array
return array

totalRows() public method

Get the total rows
public totalRows ( ) : integer
return integer

totalTime() public method

Get the total time
public totalTime ( ) : integer
return integer

Property Details

$_connectionName protected_oe property

Name of the connection being logged.
protected string $_connectionName
return string

$_logger protected_oe property

Decorated logger.
protected LoggedQuery,Cake\Database\Log $_logger
return Cake\Database\Log\LoggedQuery

$_queries protected_oe property

Logs from the current request.
protected array $_queries
return array

$_totalRows protected_oe property

Total rows of all queries
protected int $_totalRows
return integer

$_totalTime protected_oe property

Total time (ms) of all queries
protected int $_totalTime
return integer