开发者

How to log all Doctrine queries to file?

开发者 https://www.devze.com 2022-12-30 05:02 出处:网络
I\'m using Doctrine and want to log all generated SQL queries. I know tha开发者_StackOverflow社区t I could use $q->getSqlQuery() but I don\'t want to do that manually each time.

I'm using Doctrine and want to log all generated SQL queries.

I know tha开发者_StackOverflow社区t I could use $q->getSqlQuery() but I don't want to do that manually each time.

Is there a way to do it automatically?


If you turn logging on all queries shoudl be logged to your application log in the log directory. To do this set logging_enabled to true in your settings.yml.


Take a look at Doctrine Profiler and the source of ZF_Debug & Doctrine.

0

精彩评论

暂无评论...
验证码 换一张
取 消