Debug Doctrine 2 real SQL queries with parameters
composer require cmyker/doctrine-sql-logger:dev-master
$connection = $this->getEntityManager()->getConnection();
$logger = new \Cmyker\DoctrineSqlLogger\Logger($connection);
$connection->getConfiguration()->setSQLLogger($logger);
//some query here
$monologLogger->debug($logger->lastQuery); //or see the output
TODO more details