mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-05 04:37:38 +02:00
MongoDBHandler: support for MongoDB\Client
This commit is contained in:
@@ -31,8 +31,8 @@ class MongoDBHandler extends AbstractProcessingHandler
|
|||||||
|
|
||||||
public function __construct($mongo, $database, $collection, $level = Logger::DEBUG, $bubble = true)
|
public function __construct($mongo, $database, $collection, $level = Logger::DEBUG, $bubble = true)
|
||||||
{
|
{
|
||||||
if (!($mongo instanceof \MongoClient || $mongo instanceof \Mongo)) {
|
if (!($mongo instanceof \MongoClient || $mongo instanceof \Mongo || $mongo instanceof \MongoDB\Client)) {
|
||||||
throw new \InvalidArgumentException('MongoClient or Mongo instance required');
|
throw new \InvalidArgumentException('MongoClient, Mongo or MongoDB\Client instance required');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->mongoCollection = $mongo->selectCollection($database, $collection);
|
$this->mongoCollection = $mongo->selectCollection($database, $collection);
|
||||||
|
Reference in New Issue
Block a user