Debugging

← Debugging

Ashterix

docs(articles): English translation of From Magento to Symfony

en/articles/magento-to-symfony/quality/debug.md new file +18 −0

1 + # Debugging
2 +
3 + The most powerful tool, and one Magento lacks out of the box. `composer require --dev symfony/profiler-pack` adds a toolbar at the bottom of every page in dev and a full request profile at `/_profiler`.
4 +
5 + | Profiler tab | What to look for |
6 + |---|---|
7 + | Doctrine | Number of queries, duplicates, N+1, EXPLAIN, mapping errors. |
8 + | Events | Which listeners ran, in what order and how long they took. |
9 + | Security | Current user, roles, firewall, voter decisions. |
10 + | Performance | Request timeline: where the time went. |
11 + | Logs, Exception | Logs of this request, the exception stack trace. |
12 + | Validator | Validation errors per field. |
13 + | Messenger, Cache, HTTP Client | Dispatched messages, cache hits and misses, outgoing requests. |
14 +
15 + - `dump($x)` outputs to the profiler, `dd($x)` dumps and stops.
16 + - The profile of AJAX and API requests opens via the link in the `X-Debug-Token-Link` header.
17 + - In console commands, `-vvv` shows logs and the stack trace.
18 + - Xdebug works the same way as in Magento.