cakephp3 query log


\Cake\Log\Log::config('queries', [
'className' => 'Console',
'stream' => 'php://stderr',
'scopes' => ['queriesLog']
]);

$sources = \Cake\Datasource\ConnectionManager::configured();

foreach ($sources as $source) {
\Cake\Datasource\ConnectionManager::get($source)->logQueries(true);;
}