Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 40e16e4

Browse filesBrowse files
committed
Fix compatibility with Monolog 2
1 parent 7c7d981 commit 40e16e4
Copy full SHA for 40e16e4

File tree

Expand file treeCollapse file tree

1 file changed

+9
-12
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-12
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Monolog/Handler/ServerLogHandler.php
+9-12Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
namespace Symfony\Bridge\Monolog\Handler;
1313

1414
use Monolog\Formatter\FormatterInterface;
15-
use Monolog\Handler\AbstractHandler;
15+
use Monolog\Handler\AbstractProcessingHandler;
1616
use Monolog\Logger;
1717
use Symfony\Bridge\Monolog\Formatter\VarDumperFormatter;
1818

1919
/**
2020
* @author Grégoire Pineau <lyrixx@lyrixx.info>
2121
*/
22-
class ServerLogHandler extends AbstractHandler
22+
class ServerLogHandler extends AbstractProcessingHandler
2323
{
2424
private $host;
2525
private $context;
@@ -56,6 +56,11 @@ public function handle(array $record): bool
5656
restore_error_handler();
5757
}
5858

59+
return parent::$this->handle($record);
60+
}
61+
62+
protected function write(array $record): void
63+
{
5964
$recordFormatted = $this->formatRecord($record);
6065

6166
set_error_handler(self::class.'::nullErrorHandler');
@@ -72,16 +77,14 @@ public function handle(array $record): bool
7277
} finally {
7378
restore_error_handler();
7479
}
75-
76-
return false === $this->bubble;
7780
}
7881

7982
/**
8083
* {@inheritdoc}
8184
*
8285
* @return FormatterInterface
8386
*/
84-
protected function getDefaultFormatter()
87+
protected function getDefaultFormatter(): FormatterInterface
8588
{
8689
return new VarDumperFormatter();
8790
}
@@ -103,13 +106,7 @@ private function createSocket()
103106

104107
private function formatRecord(array $record): string
105108
{
106-
if ($this->processors) {
107-
foreach ($this->processors as $processor) {
108-
$record = $processor($record);
109-
}
110-
}
111-
112-
$recordFormatted = $this->getFormatter()->format($record);
109+
$recordFormatted = $record['formatted'];
113110

114111
foreach (['log_uuid', 'uuid', 'uid'] as $key) {
115112
if (isset($record['extra'][$key])) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.