$processors
$processors : callable[]
Logs to a MongoDB database.
Usage example:
$log = new \Monolog\Logger('application'); $client = new \MongoDB\Client('mongodb://localhost:27017'); $mongodb = new \Monolog\Handler\MongoDBHandler($client, 'logs', 'prod'); $log->pushHandler($mongodb);
The above examples uses the MongoDB PHP library's client class; however, the MongoDB\Driver\Manager class from ext-mongodb is also supported.
$processors : callable[]
$formatter : ?\Monolog\Formatter\FormatterInterface
$level : int
$bubble : bool
$manager : \MongoDB\Client|\MongoDB\Driver\Manager
$namespace : string
__construct(\MongoDB\Client|\MongoDB\Driver\Manager $mongodb, string $database, string $collection, mixed $level = Logger::DEBUG, bool $bubble = true) : mixed
Constructor.
\MongoDB\Client|\MongoDB\Driver\Manager | $mongodb | MongoDB library or driver client |
string | $database | Database name |
string | $collection | Collection name |
mixed | $level | |
bool | $bubble |