New in Symfony 5.3: Improved Debug Commands

Debug console commands are one of the key parts of the Symfony debugging experience. In Symfony 5.3 we improved them with new features and new commands.

Debug Events by Event Dispatcher¶

        Contributed by 
        Timo Bakx 
        in #39276.

The recent features introduced in the Security component have changed the number of event dispatchers Symfony applications have by default. Each firewall now defines its own dispatcher, whereas the debug:event-dispatcher command only displays the default dispatcher. In Symfony 5.3 we added a new --dispatcher option to display the events associated to the given event dispatcher: 1 2 3 4 5 6 7 8 9 10 11 12 13$ php bin/console debug:event-dispatcher --dispatcher=security.event_dispatcher.main

Registered Listeners of Event Dispatcher "security.event_dispatcher.main" Grouped by Event

"Symfony\Component\Security\Http\Event\LogoutEvent" event


Order Callable Priority


1 Symfony\Component\Security\Http\EventListener\CsrfTokenClearingLogoutListener::onLogout() 0


Better Event Debugging¶

        Contributed by 
        Tobias Nyholm 
        in #39323.

In Symfony 4.3 we started moving away from strings to name events in favor of using fully-qualified class names. This makes your code simpler, but it complicates the usage of the debug:event-dispatcher command when you want to filter by event. 1 2 3 4 5 6 7 8 9 10# you need to type the entire event FQCN to debug it $ php bin/console debug:event-dispatcher Symfony\Component\Mailer\Event\MessageEvent


Order Callable Priority


1 Symfony\Component\Mailer\EventListener\MessageListener::onMessage() 0

2 Symfony\Component\Mailer\EventListener\EnvelopeListener::onMessage() -255

3 Symfony\Component\Mailer\EventListener\MessageLoggerListener::onMessage() -255


In Symfony 5.3 we improved this command to search for events using its full name or any part of it. That’s way the following commands produce the same result as above: 1 2 3 4 5$ php bin/console debug:event-dispatcher Mailer $ php bin/console debug:event-dispatcher mailer $ php bin/console debug:event-dispatcher MessageEvent $ php bin/console debug:event-dispatcher messageEvent $ php bin/console debug:event-dispatcher messageevent

New Command to Debug Firewalls¶

        Contributed by 
        Timo Bakx 
        in #39326.

As part of the recent improvements related to security, in Symfony 5.3 we’ve added a new command to debug security firewalls. Run the command without arguments to list the firewalls or pass a firewall name to debug it: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40$ php bin/console debug:firewall main

Firewall "main"


Option                  Value

Name                    main
Context                 main
Lazy                    Yes
Stateless               No
User Checker            security.user_checker
Provider                security.user.provider.concrete.app_user_provider
Entry Point             App\Security\LoginFormAuthenticator
Access Denied URL
Access Denied Handler

User switching


Option      Value

Parameter   test
Provider    security.user.provider.concrete.app_user_provider
User Role   ROLE_SWITCH_POSSIBLE

Event listeners for firewall "main"

"Symfony\Component\Security\Http\Event\LoginSuccessEvent" event

// ...

Authenticators for firewall "main"

// ...

                Sponsor the Symfony project.

http://feedproxy.google.com/~r/symfony/blog/~3/81Qv_5E2d38/new-in-symfony-5-3-improved-debug-commands

Created 4y | May 6, 2021, 7:20:18 AM


Login to add comment

Other posts in this group

A Week of Symfony #955 (April 14–20, 2025)

This week, the upcoming Symfony 7.3 version improved the AsAlias attribute by adding a new argument, introduced Clock support for UriSigner, and refined the return type of the ContainerInterface::get(

Apr 20, 2025, 8:30:06 AM | Symfony
SymfonyOnline June 2025: Rethinking File Handling in Symfony

SymfonyOnline June 2025 is almost here, starting in almost 2 months on:

June 10-11: Workshop days. It is possible to attend 1 two-day training or 2 one-day trainings. June 12-13: Online confe

Apr 16, 2025, 4:30:02 PM | Symfony
SymfonyLive Paris 2025: Recap and replay!

SymfonyLive Paris 2025 took place three weeks ago — a big thank you to everyone who joined us! The conference was held entirely in French, and now you can relive the best moments: replays, hig

Apr 15, 2025, 2:50:24 PM | Symfony
A Week of Symfony #954 (April 7–13, 2025)

This week, Symfony 7.3 entered its "feature freeze" period in preparation for its release at the end of May 2025. Development activity focused on refining and polishing its new features, including a n

Apr 13, 2025, 9:40:02 AM | Symfony
SymfonyOnline June 2025: What's New in Symfony 7.3

SymfonyOnline June 2025 is almost here, starting in almost 2 months on:

June 10-11: Workshop days. It is possible to attend 1 two-day training or 2 one-day trainings. June 12-13: Online confe

Apr 10, 2025, 4:40:34 PM | Symfony
SymfonyCon Amsterdam 2025: Last days to enjoy early bird tickets!

The international Symfony conference of the year, SymfonyCon Amsterdam 2025, will take place in the Netherlands on November 27 & 28, 2025!

⏳ Early bird registration ends this Wednesday! D

Apr 8, 2025, 9:10:13 AM | Symfony
A Week of Symfony #953 (March 31 – April 6, 2025)

This week, the upcoming Symfony 7.3 version entered its feature freeze period to tweak and polish its new features before releasing it at the end of May 2025. In addition, we celebrated the SymfonyLiv

Apr 6, 2025, 8:30:10 AM | Symfony