Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f1edfa7

Browse files
committed
[MonologBridge] Do not silence errors in ServerLogHandler::formatRecord
1 parent 1006959 commit f1edfa7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Symfony/Bridge/Monolog/Handler/ServerLogHandler.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,15 @@ public function handle(array $record)
5151
if (!$this->socket = $this->socket ?: $this->createSocket()) {
5252
return false === $this->bubble;
5353
}
54+
} finally {
55+
restore_error_handler();
56+
}
5457

55-
$recordFormatted = $this->formatRecord($record);
58+
$recordFormatted = $this->formatRecord($record);
5659

60+
set_error_handler(self::class.'::nullErrorHandler');
61+
62+
try {
5763
if (-1 === stream_socket_sendto($this->socket, $recordFormatted)) {
5864
stream_socket_shutdown($this->socket, STREAM_SHUT_RDWR);
5965

0 commit comments

Comments
 (0)