Skip to content

Commit 62d0e15

Browse files
authored
Debugging Components: Info for PHP
1 parent ec09cdf commit 62d0e15

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/LiveComponent/doc/index.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3715,6 +3715,11 @@ Debugging Components
37153715
Need to list or debug some component issues.
37163716
The `Twig Component debug command`_ can help you.
37173717

3718+
To debug your PHP code, you can inject a `private LoggerInterface $logger` in your `__construct`.
3719+
Then you can use `$this->logger->debug('Message', ['var' => $var]);` and see the output in `var/log/dev.log`.
3720+
`dump` won't display anything anywhere (not even the debug toolbar).
3721+
`dd` will display in your browser, but will also deadlock your component - you cannot dismiss it and continue working.
3722+
37183723
Test Helper
37193724
-----------
37203725

0 commit comments

Comments
 (0)