Skip to content

Commit 12f9c39

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

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
@@ -2845,6 +2845,69 @@ Use the application logger instead of the PHP logger for logging PHP errors.
28452845
When an integer value is used, it also sets the log level. Those integer
28462846
values must be the same used in the `error_reporting PHP option`_.
28472847

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

0 commit comments

Comments
 (0)