如何将所有原则查询记录到文件? [英] How to log all Doctrine queries to file?
本文介绍了如何将所有原则查询记录到文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道我可以使用 $ q-> getSqlQuery ()
但是我不想每次手动执行。
有没有办法自动执行?
解决方案
如果您将所有查询的日志记录shoudl记录到您的应用程序日志日志
目录。要执行此操作,请在 settings.yml
中将 logging_enabled
设置为true。
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?
解决方案
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
.
这篇关于如何将所有原则查询记录到文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文