orm icon indicating copy to clipboard operation
orm copied to clipboard

set logger to all drivers via `DBAL->setLogger()`

Open roxblnfk opened this issue 5 years ago • 4 comments

The DatabaseManager class uses the LoggerTrait trait He has the setLogger($logger) method

If i want to log SQL queries then i call setLogger() method on DatabaseManager object But all existing drivers do not recieve LoggerInterface because drivers were created when created the DatabaseManager instance

It would be great if instead of this code:

foreach ($dbal->getDrivers() as $driver) {
    $driver->setLogger($this->logger);
}

... i could use this:

$dbal->setLogger($this->logger);

roxblnfk avatar Jan 28 '20 17:01 roxblnfk

I would greatly appreciate any help with it.

wolfy-j avatar Feb 08 '20 12:02 wolfy-j

See spiral/database

wolfy-j avatar Feb 08 '20 12:02 wolfy-j

Can be unresolved because this test cases do fail And this code is still actual

roxblnfk avatar Nov 10 '21 17:11 roxblnfk