8000 minor #10897 Removed a small article about console logging (javieregu… · symfony/symfony-docs@a241a7a · GitHub
[go: up one dir, main page]

Skip to content

Commit a241a7a

Browse files
committed
minor #10897 Removed a small article about console logging (javiereguiluz)
This PR was merged into the 3.4 branch. Discussion ---------- Removed a small article about console logging This article was important in the past, but now it's irrelevant, so let's merge it into the main Console article. Commits ------- 23bd98c Removed a small article about console logging
2 parents 08041e8 + 23bd98c commit a241a7a

File tree

4 files changed

+14
-17
lines changed

4 files changed

+14
-17
lines changed

_build/redirection_map

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
/cookbook/console/commands_as_services /console/commands_as_services
118118
/cookbook/console/console_command /console
119119
/cookbook/console/index /console
120-
/cookbook/console/logging /console/logging
120+
/cookbook/console/logging /console
121121
/cookbook/console/request_context /console/request_context
122122
/cookbook/console/style /console/style
123123
/cookbook/console/usage /console/usage
@@ -359,3 +359,4 @@
359359
/weblink /web_link
360360
/components/weblink /components/web_link
361361
/frontend/encore/installation-no-flex /frontend/encore/installation
362+
/console/logging /console

components/console/events.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ Listeners receive a
129129
$event->setError(new \LogicException('Caught exception', $exitCode, $event->getError()));
130130
});
131131

132+
.. _console-events-terminate:
133+
132134
The ``ConsoleEvents::TERMINATE`` Event
133135
--------------------------------------
134136

console.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ For example, you may want a command to create a user::
2929
{
3030
// the name of the command (the part after "bin/console")
3131
protected static $defaultName = 'app:create-user';
32-
32+
3333
protected function configure()
3434
{
3535
// ...
@@ -314,6 +314,15 @@ console::
314314
:class:`Symfony\\Component\\Console\\Application <Symfony\\Component\\Console\\Application>`
315315
and extend the normal ``\PHPUnit\Framework\TestCase``.
316316

317+
Logging Command Errors
318+
----------------------
319+
320+
Whenever an exception is thrown while running commands, Symfony adds a log
321+
message for it including the entire failing command. In addition, Symfony
322+
registers an :doc:`event subscriber </event_dispatcher>` to listen to the
323+
:ref:`ConsoleEvents::TERMINATE event <console-events-terminate>` and adds a log
324+
message whenever a command doesn't finish with the ``0`` exit status.
325+
317326
Learn More
318327
----------
319328

console/logging.rst

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0