1
votes

I deployed a Symfony2 Console Command that runs Doctrine2 queries. I am now getting problems with the queries (when flushing the EntityManager) and would like to see the queries for debugging. So the question is simple: is there a way to debug queries executed in a console command giving similar results than the Symfony2 toolbar? Ideally, I would like to be able to see the queries in the console as well (since I am having problems only in the production server and have disabled access to the dev environment from the front controller).

Thank you!

1
what is the DMBS that you're using?DonCallisto
The DBMS is MySQL, but this information should not be determinant to answer the question IMHO (since Doctrine is using PDO). I don't want a solution based on the DBMS logs (depending on the hosting provider, you might not have logs or not have access to them). But thanks for your enquiry anyway ;-)Vincent Pazeller
I ask just for suggest you to use DMBS logs ;-)DonCallisto
Thats what I understood from your first comment ^^Vincent Pazeller

1 Answers

2
votes

You can use the profiler to display the queries yourself after the command has ended, or after each flush.