Skip to content

[WebServerBundle] Error after starting server:log #25025

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
maidmaid opened this issue Nov 19, 2017 · 1 comment
Closed

[WebServerBundle] Error after starting server:log #25025

maidmaid opened this issue Nov 19, 2017 · 1 comment

Comments

@maidmaid
Copy link
Contributor

Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 4.0.0-BETA4

If I launch server:log without the log recipe, an error exception from Application.php is thrown:

$ php bin/console server:log -vvv

In Application.php line 835:
                                                    
  [ErrorException]                                  
  Warning: Invalid argument supplied for foreach()  
                                                    

Exception trace:
 Symfony\Component\Console\Application->doRunCommand() at /tmp/tmp.WXDjJ0JAbN/vendor/symfony/framework-bundle/Console/Application.php:83
 Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /tmp/tmp.WXDjJ0JAbN/vendor/symfony/console/Application.php:217
 Symfony\Component\Console\Application->doRun() at /tmp/tmp.WXDjJ0JAbN/vendor/symfony/framework-bundle/Console/Application.php:71
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /tmp/tmp.WXDjJ0JAbN/vendor/symfony/console/Application.php:124
 Symfony\Component\Console\Application->run() at /tmp/tmp.WXDjJ0JAbN/bin/console:36

Reproducer:

$ composer create-project symfony/skeleton . @dev && composer require server && php bin/console server:log
@sroze
Copy link
Contributor

sroze commented Nov 19, 2017

@maidmaid this is because Monolog is not registered as dependency on your project. Run composer req monolog to use your command.

Internally, this is because the command is not enabled. For now, to follow our policy so far, the following PR hides the command when monolog is not available: #25027

nicolas-grekas added a commit that referenced this issue Nov 19, 2017
…roze)

This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] Hide server:log command based on deps

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #25025
| License       | MIT
| Doc PR        | ø

Remove the `server:log` command if monolog is not installed.

Commits
-------

b505ac7 Remove the `server:log` command if monolog is not loaded
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants