Skip to content

Commit

Permalink
bug #23082 [MonologBridge] Do not silence errors in ServerLogHandler:…
Browse files Browse the repository at this point in the history
…: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
-------

f1edfa7 [MonologBridge] Do not silence errors in ServerLogHandler::formatRecord
  • Loading branch information
fabpot committed Jun 6, 2017
2 parents 1006959 + f1edfa7 commit 99573dc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Symfony/Bridge/Monolog/Handler/ServerLogHandler.php
Expand Up @@ -51,9 +51,15 @@ public function handle(array $record)
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);

Expand Down

0 comments on commit 99573dc

Please sign in to comment.