if ($driver instanceof NamedInterface && isset($this->config['drivers'][$driver->getName()])) {
$channel = $this->config['drivers'][$driver->getName()];
} else if (isset($this->config['drivers'][$driver::class])) {
$channel = $this->config['drivers'][$driver::class];
} else if (isset($this->config['default']) && $this->config['default'] !== null) {
$channel = $this->config['default'];
}
// Here is an example of how to do it
if (\is_subclass_of($channel, LoggerInterface::class)) {
return $this->container->get($channel);
}
return $this->container->get(LogsInterface::class)->getLogger($channel);
It will be better to support a PSR class name in
$config['database']['logger']['default']