From 6e5219c573dc8a0d523330320759fe25d53f5062 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=D0=98U=D0=AFd=20da=20silva?= Date: Wed, 28 Nov 2018 16:03:14 +0100 Subject: [PATCH 1/3] more specific explanation of the behaviour This section wasn't specific about the new behavior. I added an explanation copy/pasted from symfony's blog explanation : https://symfony.com/blog/new-in-symfony-3-3-automatic-console-logging --- console/logging.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/console/logging.rst b/console/logging.rst index 000165112b0..314f12c7a17 100644 --- a/console/logging.rst +++ b/console/logging.rst @@ -11,5 +11,19 @@ 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 ` service to log messages. From 7f5b6fa978f9ebddc0310a3e28d7836f72b8876b Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Mon, 31 Dec 2018 11:44:53 +0100 Subject: [PATCH 2/3] Update console/logging.rst Co-Authored-By: bruno-ds --- console/logging.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/console/logging.rst b/console/logging.rst index 314f12c7a17..72f973384ab 100644 --- a/console/logging.rst +++ b/console/logging.rst @@ -11,7 +11,8 @@ 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: +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 From 286ad8e14d9ae48a2c5e919a3a6867abcc185af4 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Mon, 31 Dec 2018 11:45:43 +0100 Subject: [PATCH 3/3] Update console/logging.rst Co-Authored-By: bruno-ds --- console/logging.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/console/logging.rst b/console/logging.rst index 72f973384ab..bba568798f2 100644 --- a/console/logging.rst +++ b/console/logging.rst @@ -22,7 +22,9 @@ like the following in your log file: 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. +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.