Yii Framework Forum: Is there a log of SQL queries? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Is there a log of SQL queries? Rate Topic: -----

#1 User is offline   SystemicPlural 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 129
  • Joined: 12-April 10

Posted 11 August 2010 - 05:47 AM

I'm building a test for a model method and it is failing yet works fine in the main code.

Stepping through with xdebug has issues; the result set is just filled with an infinite number of empty strings all called 'CLASSNAME'. This is often the case when I step through a test.

I can't use the normal method of viewing the final SQL query by printing the log to the screen - by setting up CWebLogRoute in the config, as it is a test and is not associated with a web page.

I've tried commenting out 'levels' for CFileLogRoute, so that it is set up the same as cWebLogRoute, but this does not result in the SQL queries being printed in the log file. They are saved to the file if I make this change in the main config and a normal page is called. The config is in the correct file - test.php

I'm stumped. Any suggestions?
0

#2 User is offline   SystemicPlural 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 129
  • Joined: 12-April 10

Posted 11 August 2010 - 06:01 AM

No problem, I found the solution here http://www.yiiframew...-while-testing/
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users