class MongoLog (View source)

Constants

NONE

ALL

WARNING

INFO

FINE

RS

POOL

IO

SERVER

PARSE

CON

Methods

static bool
setCallback(callable $log_function)

(PECL mongo >= 1.3.0)

This function will set a callback function to be called for https://secure.php.net/manual/en/class.mongolog.php MongoLog events instead of triggering warnings.

static void
setLevel(int $level)

This function can be used to set how verbose logging should be and the types of activities that should be logged. Use the constants described in the MongoLog section with bitwise operators to specify levels.

static int
getLevel()

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

static void
setModule(int $module)

This function can be used to set which parts of the driver's functionality should be logged. Use the constants described in the MongoLog section with bitwise operators to specify modules.

static int
getModule()

This function can be used to see which parts of the driver's functionality are being logged. Use the constants described in the MongoLog section with bitwise operators to check if specific modules are being logged.

Details

static bool setCallback(callable $log_function)

(PECL mongo >= 1.3.0)

This function will set a callback function to be called for https://secure.php.net/manual/en/class.mongolog.php MongoLog events instead of triggering warnings.

Parameters

callable $log_function

The function to be called on events.

The function should have the following prototype

log_function ( int $module , int $level, string $message)

  • module

    One of the https://secure.php.net/manual/en/class.mongolog.php#mongolog.constants.module MongoLog module constants.

  • level

    One of the https://secure.php.net/manual/en/class.mongolog.php#mongolog.constants.level MongoLog level constants.

  • message

    The log message itself.

    Return Value

    bool

    Returns TRUE on success or FALSE on failure.

    static void setLevel(int $level)

    This function can be used to set how verbose logging should be and the types of activities that should be logged. Use the constants described in the MongoLog section with bitwise operators to specify levels.

    Parameters

    int $level

    The levels you would like to log

    Return Value

    void

    static int getLevel()

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

    Return Value

    int

    Returns the current level

    static void setModule(int $module)

    This function can be used to set which parts of the driver's functionality should be logged. Use the constants described in the MongoLog section with bitwise operators to specify modules.

    Parameters

    int $module

    The module(s) you would like to log

    Return Value

    void

    static int getModule()

    This function can be used to see which parts of the driver's functionality are being logged. Use the constants described in the MongoLog section with bitwise operators to check if specific modules are being logged.

    Return Value

    int

    Returns the modules currently being logged