views:

18

answers:

0

I need to add sql logging to work in native WebProfileBundle. When I do one default connection in application config, I see the sql queries in my log. But my application uses many connections to many db servers, so I can't add all the possible connections to config file.

I create runtime connections, i.e.:

$config = array(
        'user' => 'user1',
        'password' => 'pass1',
        'driver' => 'pdo_mysql',
        'port' => 3306,
);
$conn = DriverManager::getConnection($config);

then I think, should be command something like this

$conn->getConfiguration()->getSQLLogger($someLoggerObject);

I've tried to solve this problem with DependencyInjection, took DoctrineBundle as example. But have no luck.

Any help with live code or link to proper documentation would be great