Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to log all Doctrine queries to file?

Tags:

doctrine

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?

like image 202
never_had_a_name Avatar asked May 10 '10 03:05

never_had_a_name


1 Answers

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.

like image 136
prodigitalson Avatar answered Nov 12 '22 21:11

prodigitalson