How to log all Doctrine queries to file?

旧街凉风 提交于 2019-12-12 10:43:20

问题


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

I know that I could use $q->getSqlQuery() but I don't want to do that manually each time.

Is there a way to do it automatically?


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/2800226/how-to-log-all-doctrine-queries-to-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!