yiisoft / yiisoft/app

DX: Console should not output errors unless verbosity level is high

Open
#445 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
381
Forks
68
Avg merge
1h 10m
Merged PRs (30d)
1

Description

Description

Currently console commands are outputted like this by default:

❯ make yii test
docker compose -f docker/compose.yml -f docker/dev/compose.yml run --rm app ./yii test
[+]  1/1t 1/11
 ✔ Container app-db-1 Running                                                                                                                                                                    0.0s
Container app-db-1 Waiting
Container app-db-1 Healthy
Container app-app-run-5ad508edd1f4 Creating
Container app-app-run-5ad508edd1f4 Created


  Command "test" is not defined.


#0 /app/vendor/symfony/console/Application.php(298): Symfony\Component\Console\Application->find('test')
#1 /app/vendor/symfony/console/Application.php(195): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Yiisoft\Yii\Console\Output\ConsoleBufferedOutput))
#2 /app/vendor/yiisoft/yii-runner-console/src/ConsoleApplicationRunner.php(112): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Yiisoft\Yii\Console\Output\ConsoleBufferedOutput))
#3 /app/yii(18): Yiisoft\Yii\Runner\Console\ConsoleApplicationRunner->run()
#4 {main}
2026-02-22 07:59:41.335000 [error][application] Symfony\Component\Console\Exception\CommandNotFoundException: Command "test" is not defined. in /app/vendor/symfony/console/Application.php:759 while running console command "unknown".

Message context:

trace:

time: 1771747181.335032
memory: 5520824
category: 'application'
exception: Symfony\Component\Console\Exception\CommandNotFoundException: Command "test" is not defined. in /app/vendor/symfony/console/Application.php:759
Stack trace:
#0 /app/vendor/symfony/console/Application.php(298): Symfony\Component\Console\Application->find('test')
#1 /app/vendor/symfony/console/Application.php(195): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Yiisoft\Yii\Console\Output\ConsoleBufferedOutput))
#2 /app/vendor/yiisoft/yii-runner-console/src/ConsoleApplicationRunner.php(112): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Yiisoft\Yii\Console\Output\ConsoleBufferedOutput))
#3 /app/yii(18): Yiisoft\Yii\Runner\Console\ConsoleApplicationRunner->run()
#4 {main}

That is because in config/common/di/logger.php there is StreamTarget::class outputs all levels regardless of verbosity v|vv|vvv, --verbose. Ideally, by default in console it should react to verbosity flags to change log output levels.

Package version

No response

PHP version

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with config/common/di/logger.php and inspect how StreamTarget is configured for console output. Trace the console runner's verbosity flags and related logging entry points to determine the expected level filtering. Done means default console commands no longer print error details unless the appropriate verbosity level is enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.