Skip to content

Commit 6e29f18

Browse files
minor symfony#25026 [MonologBridge][WebServerBundle] Add suggestions for using the log server (maidmaid)
This PR was merged into the 3.3 branch. Discussion ---------- [MonologBridge][WebServerBundle] Add suggestions for using the log server | Q | A | ------------- | --- | Branch? | 3.3 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | / | License | MIT | Doc PR | / If you want launch `server:log`, you need the monolog bridge and the VarDumper. Optionally, you need EL if you want use `server:log --filter`. Commits ------- aca0ddd Add suggestions
2 parents b4e0a45 + aca0ddd commit 6e29f18

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

src/Symfony/Bridge/Monolog/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
"suggest": {
3232
"symfony/http-kernel": "For using the debugging handlers together with the response life cycle of the HTTP kernel.",
3333
"symfony/console": "For the possibility to show log messages in console commands depending on verbosity settings. You need version ~2.3 of the console for it.",
34-
"symfony/event-dispatcher": "Needed when using log messages in console commands."
34+
"symfony/event-dispatcher": "Needed when using log messages in console commands.",
35+
"symfony/var-dumper": "For using the debugging handlers like the console handler or the log server handler."
3536
},
3637
"autoload": {
3738
"psr-4": { "Symfony\\Bridge\\Monolog\\": "" },

src/Symfony/Bundle/WebServerBundle/Command/ServerLogCommand.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Bundle\WebServerBundle\Command;
1313

14+
use Monolog\Formatter\FormatterInterface;
1415
use Symfony\Bridge\Monolog\Formatter\ConsoleFormatter;
1516
use Symfony\Bridge\Monolog\Handler\ConsoleHandler;
1617
use Symfony\Component\Console\Command\Command;
@@ -35,6 +36,11 @@ public function isEnabled()
3536
return false;
3637
}
3738

39+
// based on a symfony/symfony package, it crashes due a missing FormatterInterface from monolog/monolog
40+
if (!class_exists(FormatterInterface::class)) {
41+
return false;
42+
}
43+
3844
return parent::isEnabled();
3945
}
4046

src/Symfony/Bundle/WebServerBundle/composer.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
"conflict": {
3131
"symfony/dependency-injection": "<3.3"
3232
},
33+
"suggest": {
34+
"symfony/monolog-bridge": "For using the log server.",
35+
"symfony/expression-language": "For using the filter option of the log server."
36+
},
3337
"minimum-stability": "dev",
3438
"extra": {
3539
"branch-alias": {

0 commit comments

Comments
 (0)