bug #23082 [MonologBridge] Do not silence errors in ServerLogHandler::formatRecord (lyrixx)

This PR was merged into the 3.3 branch.

Discussion
----------

[MonologBridge] Do not silence errors in ServerLogHandler::formatRecord

| Q             | A
| ------------- | ---
| Branch?       | 3.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

<!--
- Bug fixes must be submitted against the lowest branch where they apply
  (lowest branches are regularly merged to upper ones so they get the fixes too).
- Features and deprecations must be submitted against the 3.4,
  legacy code removals go to the master branch.
- Please fill in this template according to the PR you're about to submit.
- Replace this comment by a description of what your PR is solving.
-->

Commits
-------

f1edfa7ec2 [MonologBridge] Do not silence errors in ServerLogHandler::formatRecord
This commit is contained in:
Fabien Potencier 2017-06-06 08:24:58 -07:00
commit 99573dc45b

View File

@ -51,9 +51,15 @@ class ServerLogHandler extends AbstractHandler
if (!$this->socket = $this->socket ?: $this->createSocket()) {
return false === $this->bubble;
}
} finally {
restore_error_handler();
}
$recordFormatted = $this->formatRecord($record);
$recordFormatted = $this->formatRecord($record);
set_error_handler(self::class.'::nullErrorHandler');
try {
if (-1 === stream_socket_sendto($this->socket, $recordFormatted)) {
stream_socket_shutdown($this->socket, STREAM_SHUT_RDWR);