mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-05 04:37:38 +02:00
Added support for working with BufferHandler (#1481)
* Added support for working with BufferHandler Added `handleBatch` method for TelegramBotHandler and fixed `write` method. This is necessary to work with BufferHandler, OverflowHandler etc.
This commit is contained in:
@@ -120,6 +120,30 @@ class TelegramBotHandler extends AbstractProcessingHandler
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function handleBatch(array $records): void
|
||||||
|
{
|
||||||
|
$messages = [];
|
||||||
|
|
||||||
|
foreach ($records as $record) {
|
||||||
|
if (!$this->isHandling($record)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->processors) {
|
||||||
|
$record = $this->processRecord($record);
|
||||||
|
}
|
||||||
|
|
||||||
|
$messages[] = $record;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($messages)) {
|
||||||
|
$this->send((string) $this->getFormatter()->formatBatch($messages));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user