Doctrine 2 provides a simple interface for logging, namely \Doctrine\DBAL\Logging\SQLLogger()
https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Logging/SQLLogger.php
$config = new Doctrine\ORM\Configuration ();
// ... config stuff
$config->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger());
$connectionParams = array(
'dbname' => 'example',
'user' => 'example',
'password' => 'example',
'host' => 'localhost',
'driver' => 'pdo_mysql');
//make the connection through an Array of params ($connectionParams)
$em = EntityManager::create($connectionParams, $config);