Skip to content
  • About
    • What is Symfony?
    • Community
    • News
    • Contributing
    • Support
  • Documentation
    • Symfony Docs
    • Symfony Book
    • Screencasts
    • Symfony Bundles
    • Symfony Cloud
    • Training
  • Services
    • Platform.sh for Symfony Best platform to deploy Symfony apps
    • SymfonyInsight Automatic quality checks for your apps
    • Symfony Certification Prove your knowledge and boost your career
    • SensioLabs Professional services to help you with Symfony
    • Blackfire Profile and monitor performance of your apps
  • Other
  • Blog
  • Download
sponsored by
  1. Home
  2. Documentation
  3. Service Container
  4. How to Debug the Service Container & List Services

How to Debug the Service Container & List Services

Edit this page

You can find out what services are registered with the container using the console. To show all services (public and private) and their PHP classes, run:

1
2
3
4
$ php bin/console debug:container

# add this option to display "hidden services" too (those whose ID starts with a dot)
$ php bin/console debug:container --show-hidden

To see a list of all of the available types that can be used for autowiring, run:

1
$ php bin/console debug:autowiring

Debugging Service Tags

Run the following command to find out what services are tagged with a specific tag:

1
$ php bin/console debug:container --tag=kernel.event_listener

Partial search is also available:

1
2
3
4
5
6
7
8
9
10
$ php bin/console debug:container --tag=kernel

Select one of the following tags to display its information:
 [0] kernel.event_listener
 [1] kernel.event_subscriber
 [2] kernel.reset
 [3] kernel.cache_warmer
 [4] kernel.locale_aware
 [5] kernel.fragment_renderer
 [6] kernel.cache_clearer

Detailed Info about a Single Service

You can get more detailed information about a particular service by specifying its id:

1
2
3
4
$ php bin/console debug:container App\Service\Mailer

# to show the service arguments:
$ php bin/console debug:container App\Service\Mailer --show-arguments
This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.
TOC
    Version

    Symfony 7.1 is backed by

    Take the exam at home

    Take the exam at home

    Be trained by SensioLabs experts (2 to 6 day sessions -- French or English).

    Be trained by SensioLabs experts (2 to 6 day sessions -- French or English).

    Version:

    Table of Contents

    • Debugging Service Tags
    • Detailed Info about a Single Service

    Symfony footer

    Avatar of Susheel Thapa, a Symfony contributor

    Thanks Susheel Thapa for being a Symfony contributor

    1 commit • 14 lines changed

    View all contributors that help us make Symfony

    Become a Symfony contributor

    Be an active part of the community and contribute ideas, code and bug fixes. Both experts and newcomers are welcome.

    Learn how to contribute

    Symfony™ is a trademark of Symfony SAS. All rights reserved.

    • What is Symfony?

      • What is Symfony?
      • Symfony at a Glance
      • Symfony Components
      • Symfony Releases
      • Security Policy
      • Logo & Screenshots
      • Trademark & Licenses
      • symfony1 Legacy
    • Learn Symfony

      • Symfony Docs
      • Symfony Book
      • Reference
      • Bundles
      • Best Practices
      • Training
      • eLearning Platform
      • Certification
    • Screencasts

      • Learn Symfony
      • Learn PHP
      • Learn JavaScript
      • Learn Drupal
      • Learn RESTful APIs
    • Community

      • Symfony Community
      • SymfonyConnect
      • Events & Meetups
      • Projects using Symfony
      • Contributors
      • Symfony Jobs
      • Backers
      • Code of Conduct
      • Downloads Stats
      • Support
    • Blog

      • All Blog Posts
      • A Week of Symfony
      • Case Studies
      • Cloud
      • Community
      • Conferences
      • Diversity
      • Living on the edge
      • Releases
      • Security Advisories
      • Symfony Insight
      • Twig
      • SensioLabs Blog
    • Services

      • SensioLabs services
      • Train developers
      • Manage your project quality
      • Improve your project performance
      • Host Symfony projects

      Powered by

    Follow Symfony