migrations icon indicating copy to clipboard operation
migrations copied to clipboard

ConsoleLogger not used if command is called with --em option

Open nugoirem opened this issue 2 years ago • 0 comments

ConsoleLogger won't be set as Logger-service if command is called with --em option

Example command call doctrine:migrations:migrate --em={your_entity_manager_name}

Reason

  • The function private function setNamedEmOrConnection(InputInterface $input) calls $this->dependencyFactory->getConfiguration(), which freezes dependencyFactory and prevents the setting of ConsoleLogger to command later in the line https://github.com/doctrine/migrations/blob/d7198118934b360f3a82a919c0fca9515b8de46a/lib/Doctrine/Migrations/Tools/Console/Command/DoctrineCommand.php#L100
  • I havent't seen other possibility to set ConsoleLogger as LoggerInterface

nugoirem avatar Jan 16 '23 07:01 nugoirem