8000 exception during a command: more specific explanation of the behaviour by bruno-ds · Pull Request #10719 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

exception during a command: more specific explanation of the behaviour #10719

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions console/logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,22 @@ listener for the console.
Starting from Symfony 3.3, the Console component provides automatic error and
exception logging.

When an exception occurs during the execution of a command, you'll see a message
like the following in your log file:

.. code-block:: terminal

[2017-02-15 09:34:42] app.ERROR: Exception thrown while running command:
"cache:clear -vvv". Message: "An error occured!" {"exception":"[object]
(RuntimeException(code: 0): An error occured! at vendor/symfony/symfony/
src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php:61)",
"command":"cache:clear -vvv","message":"An error occured!"} []

In addition to logging exceptions, the new subscriber also listens to the
`console.terminate` event to add a log message whenever a command
doesn't finish with the 0 exit status.



You can of course also access and use the :doc:`logger </logging>` service to
log messages.
0