1

i think its a simple question, but i cant find an answer. In CakePHP on Debug mode 2 i can see the SQL statements. Unfortunately its limited to 200. How can i configure this limit? I need to see much more.

Wooble
  • 87,717
  • 12
  • 108
  • 131
Pax
  • 19
  • 2

1 Answers1

2

Quick Fix

The quick and dirty way to do this is to edit a core file.

This is never a good idea, but here it goes:

Goto: [ROOT]/lib/Cake/Model/Datasource/DboSource.php

Find the definition of the field $_queriesLogMax = 200;

Keep in mind that changing the core will make it very difficult to upgrade cake later on. So if you do use this, use it as a temporary fix.

Good solution

However the proper way to do this is to create a subclass for the Mysql class and overwrite the method logQuery to log it to a file or in a buffer to be rendered on the page. Then in your database configuration file (database.php) you need to configure the the datasource to be your class.

Here is an example of creating your own MySQL data source with logs.

Community
  • 1
  • 1
Ilie Pandia
  • 1,829
  • 14
  • 16