Skip to content

Fix class name in ConsoleTerminateListener example #4119

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

Merged
merged 1 commit into from
Aug 16, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions cookbook/console/logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,11 @@ First configure a listener for console terminate events in the service container
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

<parameters>
<parameter key="console_terminate_listener.class">Acme\DemoBundle\EventListener\ConsoleExceptionListener</parameter>
<parameter key="console_exception_listener.class">Acme\DemoBundle\EventListener\ConsoleExceptionListener</parameter>
</parameters>

<services>
<service id="kernel.listener.command_dispatch" class="%console_terminate_listener.class%">
<service id="kernel.listener.command_dispatch" class="%console_exception_listener.class%">
<argument type="service" id="logger"/>
<tag name="kernel.event_listener" event="console.terminate" />
</service>
Expand All @@ -223,11 +223,11 @@ First configure a listener for console terminate events in the service container
use Symfony\Component\DependencyInjection\Reference;

$container->setParameter(
'console_terminate_listener.class',
'console_exception_listener.class',
'Acme\DemoBundle\EventListener\ConsoleExceptionListener'
);
$definitionConsoleExceptionListener = new Definition(
'%console_terminate_listener.class%',
'%console_exception_listener.class%',
array(new Reference('logger'))
);
$definitionConsoleExceptionListener->addTag(
Expand All @@ -247,7 +247,7 @@ Then implement the actual listener::
use Symfony\Component\Console\Event\ConsoleTerminateEvent;
use Psr\Log\LoggerInterface;

class ConsoleTerminateListener
class ConsoleExceptionListener
{
private $logger;

Expand Down