I want to be able to log full SQL queries in error.log specifically when a SQL error occurs. My debug is set to 2 in core.php.
The output is appearing as follows:
2013-01-29 19:53:21 Error: SQLSTATE[HY000]: General error: 1364 Field 'street' doesn't have a default value
#0 D:\xampp\htdocs\my_project\lib\Cake\Model\Datasource\DboSource.php(459): PDOStatement->execute(Array)
#1 D:\xampp\htdocs\my_project\lib\Cake\Model\Datasource\DboSource.php(425): DboSource->_execute('INSERT INTO `st...', Array)
#2 D:\xampp\htdocs\my_project\lib\Cake\Model\Datasource\DboSource.php(1007): DboSource->execute('INSERT INTO `st...')
As you can see, the SQL statements are only logged partially with the rest being chopped-of with ellipsis.
I'm using DebugKit in conjunction with this, but even that doesn't produce full SQL logs at time in the DebugKit window.
I'm throwing exceptions and logging the getTraceAsString() here.
Any solutions will be greatly appreciated.
Thank you,
m^e