Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debuging SQL queries in a Symfony2 Console Command

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!

like image 690
Vincent Pazeller Avatar asked Jul 01 '26 23:07

Vincent Pazeller


1 Answers

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

like image 81
Peter Kruithof Avatar answered Jul 05 '26 09:07

Peter Kruithof



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!