mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-10 15:14:14 +02:00
MongoDBHandler: write: call proper method if we've got instance of MongoDB\Collection
This commit is contained in:
@@ -42,7 +42,11 @@ class MongoDBHandler extends AbstractProcessingHandler
|
|||||||
|
|
||||||
protected function write(array $record)
|
protected function write(array $record)
|
||||||
{
|
{
|
||||||
$this->mongoCollection->save($record["formatted"]);
|
if ($this->mongoCollection instanceof \MongoDB\Collection) {
|
||||||
|
$this->mongoCollection->insertOne($record["formatted"]);
|
||||||
|
} else {
|
||||||
|
$this->mongoCollection->save($record["formatted"]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user