views:

1078

answers:

2

Hello,

I wanted to know if there is way to log the mysql queries in CakePHP being executed when we use the find method on the models, I know that rails database queries, so does Cake do the same, if so how can I enable it or use it?

Shiv

A: 

Assuming you are on a nix os, the best approach would actually to tail the mysql log itself.
You might learn some interesting things out of it.

log in Ubuntu when installing from repository

tail -f  /var/log/mysql/mysql.log
Itay Moav
no way to log it from cakephp, like we use $this->log
Shiv
by default, mysql.log is disabled because it's a huge performance killer, You'll need to disable it from my.cnf and only do so in dev. environment!
duckyflip
+2  A: 

This page has instructions on how to get Cake to log queries the same way as rails.

Logan5