Symfony2 just introduced its WebProfiler, the utility will soon be the favorite of all programmers. Most veterans will recall that five years ago was the first Symfony framework to include a web debug toolbar. This bar displays useful information for debugging applications and provides access to all logs with a single click:
Symfony2 presents its WebProfiler as the great evolution of the web debug toolbar. Whenever you view a page, Symfony2 generates a unique token debug (pictured above, the token is 4c7e59811509c). By clicking on that token, it shows the WebProfiler with all the debug information:
In the menu on the left side you can see the five main sections to the Profiler which now has:
- Request: displays information about the request and response (parameters, cookies, headers).
- Exception: if the request has caused an exception, it shows the type of exception, the message from the server and the whole execution trace.
- Events: Shows the events raised during execution of the application (along with their event listeners) and the events that have been identified but have not come to run.
- Logs: Displays the same information to log the original debug toolbar.
- Doctrine / Propel: shows the queries to the database and the time taken for each.
Another great features of the Profiler is that it keeps all your information in a database called SQLiteprofiler.db and stored in the directory cache/ in your application. With this database, you’ll be able to consult the entire execution history of your application, which will facilitate the clearance of projects:
If you want to try the Profiler, you need version of the sandbox Symfony2 PR3, which has not yet been published as a downloadable file. Therefore, when you can only download via git:
mkdir sandbox git clone http://github.com/symfony/symfony-sandbox.git sandbox cd sandbox / git checkout PR3
Now you can try accessing http://localhost/sandbox/index_dev.php




