Problem/Motivation

ConsoleSubscriber sets the Symfony ConsoleLogger on the logger.console service once, when a command starts. DrupalKernel::rebuildContainer() creates a new DrupalConsoleLogger instance without an inner logger. Log messages sent after the rebuild do not reach the console. Module install and database updates trigger this.

Steps to reproduce

Run a dr command that logs a notice, rebuilds the container, and logs a second notice through \Drupal::logger(). Only the first notice prints.

Proposed resolution

Add the persist tag to logger.console. The kernel then moves the existing instance into the rebuilt container, as it does for request_stack. A test command in console_test and a new case in ConsoleTest cover the rebuild.

API changes

None.

Generated with the help of an LLM.

Issue fork drupal-3638166

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

moshe weitzman created an issue.