File tree Expand file tree Collapse file tree 4 files changed +19
-5
lines changed
Filter options
Expand file tree Collapse file tree 4 files changed +19
-5
lines changed
Original file line number Diff line number Diff line change 119
119
/cookbook/console/commands_as_services /console/commands_as_services
120
120
/cookbook/console/console_command /console
121
121
/cookbook/console/index /console
122
- /cookbook/console/logging /console/logging
122
+ /cookbook/console/logging /console
123
123
/cookbook/console/request_context /console/request_context
124
124
/cookbook/console/style /console/style
125
125
/cookbook/console/usage /console
402
402
/components/weblink /components/web_link
403
403
/frontend/encore/installation-no-flex /frontend/encore/installation
404
404
/http_cache/form_csrf_caching /security/csrf
405
+ /console/logging /console
Original file line number Diff line number Diff line change @@ -114,6 +114,8 @@ Listeners receive a
114
114
$event->setError(new \LogicException('Caught exception', $exitCode, $event->getError()));
115
115
});
116
116
117
+ .. _console-events-terminate :
118
+
117
119
The ``ConsoleEvents::TERMINATE `` Event
118
120
--------------------------------------
119
121
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ want a command to create a user::
37
37
{
38
38
// the name of the command (the part after "bin/console")
39
39
protected static $defaultName = 'app:create-user';
40
-
40
+
41
41
protected function configure()
42
42
{
43
43
// ...
@@ -373,6 +373,15 @@ console::
373
373
:class: `Symfony\\ Component\\ Console\\ Application <Symfony\\ Component\\ Console\\ Application> `
374
374
and extend the normal ``\PHPUnit\Framework\TestCase ``.
375
375
376
+ Logging Command Errors
377
+ ----------------------
378
+
379
+ Whenever an exception is thrown while running commands, Symfony adds a log
380
+ message for it including the entire failing command. In addition, Symfony
381
+ registers an :doc: `event subscriber </event_dispatcher >` to listen to the
382
+ :ref: `ConsoleEvents::TERMINATE event <console-events-terminate >` and adds a log
383
+ message whenever a command doesn't finish with the ``0 `` exit status.
384
+
376
385
Learn More
377
386
----------
378
387
Original file line number Diff line number Diff line change @@ -338,9 +338,10 @@ dealing with the ``TransformerInterface``.
338
338
339
339
.. tip ::
340
340
341
- As long as there is only one class implementing the interface and that class
342
- is part of the same namespace configuring the alias is not mandatory and Symfony
343
- will automatically create one.
341
+ When using a `service definition prototype `_, if only one service is
342
+ discovered that implements an interface, and that interface is also
343
+ discovered at the same time, configuring the alias is not mandatory
344
+ and Symfony will automatically create one.
344
345
345
346
Dealing with Multiple Implementations of the Same Type
346
347
------------------------------------------------------
@@ -500,3 +501,4 @@ Public bundles should explicitly configure their services and not rely on autowi
500
501
501
502
.. _Rapid Application Development : https://en.wikipedia.org/wiki/Rapid_application_development
502
503
.. _ROT13 : https://en.wikipedia.org/wiki/ROT13
504
+ .. _service definition prototype : https://symfony.com/blog/new-in-symfony-3-3-psr-4-based-service-discovery
You can’t perform that action at this time.
0 commit comments