My modules/mymodule/config/services.yaml began with:
services: _defaults: autowire: true MyModule\Command\MyCommand: class: MyModule\Command\MyCommand tags: [ 'console.command' ]
Now, by adding the bind element, that seems work as I want:
services: _defaults: autowire: true bind: Psr\Log\LoggerInterface: '@monolog.logger.console' MyModule\Command\MyCommand: class: MyModule\Command\MyCommand tags: [ 'console.command' ]
Source: https://symfony.com/doc/3.4/service_container.html#binding-arguments-by-name-or-type