Skip to content

Commit 253d0bd

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: Document the option to map PHP errors to log levels [HttpClient] Add a note about concurrent requests
2 parents f3ea21e + 12f9c39 commit 253d0bd

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed

http_client.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,6 +1097,13 @@ first and be read later on. This will allow the client to monitor all pending
10971097
requests while your code waits for a specific one, as done in each iteration of
10981098
the above "foreach" loop.
10991099

1100+
.. note::
1101+
1102+
The maximum number of concurrent requests that you can perform depends on
1103+
the resources of your machine (e.g. your operating system may limit the
1104+
number of simultaneous reads of the file that stores the certificates
1105+
file). Make your requests in batches to avoid these issues.
1106+
11001107
Multiplexing Responses
11011108
~~~~~~~~~~~~~~~~~~~~~~
11021109

reference/configuration/framework.rst

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2840,6 +2840,69 @@ Use the application logger instead of the PHP logger for logging PHP errors.
28402840
When an integer value is used, it also sets the log level. Those integer
28412841
values must be the same used in the `error_reporting PHP option`_.
28422842

2843+
This option also accepts a map of PHP errors to log levels:
2844+
2845+
.. configuration-block::
2846+
2847+
.. code-block:: yaml
2848+
2849+
# config/packages/framework.yaml
2850+
framework:
2851+
php_errors:
2852+
log:
2853+
'!php/const \E_DEPRECATED': !php/const Psr\Log\LogLevel::ERROR
2854+
'!php/const \E_USER_DEPRECATED': !php/const Psr\Log\LogLevel::ERROR
2855+
'!php/const \E_NOTICE': !php/const Psr\Log\LogLevel::ERROR
2856+
'!php/const \E_USER_NOTICE': !php/const Psr\Log\LogLevel::ERROR
2857+
'!php/const \E_STRICT': !php/const Psr\Log\LogLevel::ERROR
2858+
'!php/const \E_WARNING': !php/const Psr\Log\LogLevel::ERROR
2859+
'!php/const \E_USER_WARNING': !php/const Psr\Log\LogLevel::ERROR
2860+
'!php/const \E_COMPILE_WARNING': !php/const Psr\Log\LogLevel::ERROR
2861+
'!php/const \E_CORE_WARNING': !php/const Psr\Log\LogLevel::ERROR
2862+
'!php/const \E_USER_ERROR': !php/const Psr\Log\LogLevel::CRITICAL
2863+
'!php/const \E_RECOVERABLE_ERROR': !php/const Psr\Log\LogLevel::CRITICAL
2864+
'!php/const \E_COMPILE_ERROR': !php/const Psr\Log\LogLevel::CRITICAL
2865+
'!php/const \E_PARSE': !php/const Psr\Log\LogLevel::CRITICAL
2866+
'!php/const \E_ERROR': !php/const Psr\Log\LogLevel::CRITICAL
2867+
'!php/const \E_CORE_ERROR': !php/const Psr\Log\LogLevel::CRITICAL
2868+
2869+
.. code-block:: xml
2870+
2871+
<!-- config/packages/framework.xml -->
2872+
<?xml version="1.0" encoding="UTF-8" ?>
2873+
<container xmlns="http://symfony.com/schema/dic/services"
2874+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2875+
xmlns:framework="http://symfony.com/schema/dic/symfony"
2876+
xsi:schemaLocation="http://symfony.com/schema/dic/services
2877+
https://symfony.com/schema/dic/services/services-1.0.xsd
2878+
http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
2879+
2880+
<framework:config>
2881+
<!-- in XML configuration you cannot use PHP constants as the value of
2882+
the 'type' attribute, which makes this format way less readable.
2883+
Consider using YAML or PHP for this configuration -->
2884+
<framework:log type="8" logLevel="error"/>
2885+
<framework:log type="2" logLevel="error"/>
2886+
<!-- ... -->
2887+
</framework:config>
2888+
</container>
2889+
2890+
.. code-block:: php
2891+
2892+
// config/packages/framework.php
2893+
use Psr\Log\LogLevel;
2894+
use Symfony\Config\FrameworkConfig;
2895+
2896+
return static function (FrameworkConfig $framework) {
2897+
$framework->phpErrors()->log(\E_DEPRECATED, LogLevel::ERROR);
2898+
$framework->phpErrors()->log(\E_USER_DEPRECATED, LogLevel::ERROR);
2899+
// ...
2900+
};
2901+
2902+
.. versionadded:: 5.3
2903+
2904+
The option to map PHP errors to log levels was introduced in Symfony 5.3.
2905+
28432906
throw
28442907
.....
28452908

0 commit comments

Comments
 (0)