mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-11 07:34:12 +02:00
Add support for elastica 8, fixes #1917
This commit is contained in:
@@ -31,7 +31,7 @@
|
|||||||
"phpstan/phpstan-strict-rules": "^1.4",
|
"phpstan/phpstan-strict-rules": "^1.4",
|
||||||
"phpunit/phpunit": "^10.5.17",
|
"phpunit/phpunit": "^10.5.17",
|
||||||
"predis/predis": "^1.1 || ^2",
|
"predis/predis": "^1.1 || ^2",
|
||||||
"ruflin/elastica": "^7",
|
"ruflin/elastica": "^7 || ^8",
|
||||||
"symfony/mailer": "^5.4 || ^6",
|
"symfony/mailer": "^5.4 || ^6",
|
||||||
"symfony/mime": "^5.4 || ^6"
|
"symfony/mime": "^5.4 || ^6"
|
||||||
},
|
},
|
||||||
@@ -72,6 +72,9 @@
|
|||||||
"config": {
|
"config": {
|
||||||
"lock": false,
|
"lock": false,
|
||||||
"sort-packages": true,
|
"sort-packages": true,
|
||||||
"platform-check": false
|
"platform-check": false,
|
||||||
|
"allow-plugins": {
|
||||||
|
"php-http/discovery": false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
namespace Monolog\Handler;
|
namespace Monolog\Handler;
|
||||||
|
|
||||||
|
use Elastic\Transport\Exception\TransportException;
|
||||||
use Elastica\Document;
|
use Elastica\Document;
|
||||||
use Monolog\Formatter\FormatterInterface;
|
use Monolog\Formatter\FormatterInterface;
|
||||||
use Monolog\Formatter\ElasticaFormatter;
|
use Monolog\Formatter\ElasticaFormatter;
|
||||||
@@ -133,7 +134,7 @@ class ElasticaHandler extends AbstractProcessingHandler
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$this->client->addDocuments($documents);
|
$this->client->addDocuments($documents);
|
||||||
} catch (ExceptionInterface $e) {
|
} catch (ExceptionInterface | TransportException $e) {
|
||||||
if (!$this->options['ignore_error']) {
|
if (!$this->options['ignore_error']) {
|
||||||
throw new \RuntimeException("Error sending messages to Elasticsearch", 0, $e);
|
throw new \RuntimeException("Error sending messages to Elasticsearch", 0, $e);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user