Skip to content

Monolog Bridge with Console does not include EventDispatcher #9677

@giggsey

Description

@giggsey

composer.json:

{
"require": {
        "symfony/monolog-bridge": "~2.4",
        "symfony/console": "~2.3",
        "monolog/monolog": "*",
    }
}

Code:

<?php

require __DIR__ . '/vendor/autoload.php';

$output = new \Symfony\Component\Console\Output\ConsoleOutput();
$output->setVerbosity(Symfony\Component\Console\Output\OutputInterface::VERBOSITY_DEBUG);

$monolog = new Monolog\Logger('Instance');
$monolog->pushHandler(new \Symfony\Bridge\Monolog\Handler\ConsoleHandler($output));

Error:

PHP Fatal error:  Interface 'Symfony\Component\EventDispatcher\EventSubscriberInterface' not found in /vendor/symfony/monolog-bridge/Symfony/Bridge/Monolog/Handler/ConsoleHandler.php on line 42
PHP Stack trace:
PHP   1. {main}() run.php:0
PHP   2. Composer\Autoload\ClassLoader->loadClass() run.php:0
PHP   3. include() /vendor/composer/ClassLoader.php:185

I believe the fix is to include "symfony/event-dispatcher": "~2.2" in the composer.json for MonologBridge. I'm happy to submit this as a PR, but am not too familiar with your rules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions