(PECL mongo >=1.2.3)
Logging can be used to get detailed information about what the driver is doing. Logging is disabled by default, but this class allows you to activate specific levels of logging for various parts of the driver. Some examples:
// print every log message possible
MongoLog::setLevel(MongoLog::ALL); // all log levels
MongoLog::setModule(MongoLog::ALL); // all parts of the driver
// print significant events about replica set failover
// print info- and diagnostic-level events for replica sets and connections
By default, MongoLog emits all log messages as PHP notices. Depending on the SAPI you use, messages may be sent to stderr (for CLI) or the web server's error log. If, after configuring MongoLog, log messages are not appearing as expected, ensure that the
E_NOTICEbit is included in error_reporting and that display_errors is on.
$level) : void
$module) : void
These constants can be used by MongoLog::setLevel().
These constants can be used by MongoLog::setModule().