Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...

When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store


(PECL mongo >= 1.2.3)

MongoLog::getLevelGets the log level


public static int MongoLog::getLevel ( void )

This can be used to see the log level. Use the constants described in the MongoLog section with bitwise operators to check the level.


if (MongoLog::getLevel() & MongoLog::FINE) {
"lots 'o logs\n";

if (
MongoLog::getLevel() ^ MongoLog::NONE) {
"logging, at least a little\n";

if (
MongoLog::getLevel() == MongoLog::ALL) {
"logging at the highest levels\n";



This function has no parameters.

Return Values

Returns the current level.

PHP Manual