I followed the instructions to enable query logging in cakephp v3.
http://book.cakephp.org/3.0/en/orm/database-basics.html#query-logging
// Turn query logging on.
$conn->logQueries(true);
// Turn query logging off
$conn->logQueries(false);
use Cake\Log\Log;
// Console logging
Log::config('queries', [
'className' => 'Console',
'stream' => 'php://stderr',
'scopes' => ['queriesLog']
]);
// File logging
Log::config('queries', [
'className' => 'File',
'path' => LOGS,
'file' => 'queries.log',
'scopes' => ['queriesLog']
]);
After enabling query logging, I am not able to find the log file. I looked under the logs folder. I don't see any queries.log
. Where can the log file be found?
I've created a test project. Created a simple model so I can parse the data.
In the controller, I added these namespaces:
Here's the basic data parse in a controller:
All of this works just great.