略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: MongoLog::setModule

2024-12-23

MongoLog::setModule

(PECL mongo >= 1.2.3)

MongoLog::setModuleSets the module(s) to be logged

说明

public static MongoLog::setModule ( int $module ) : void

This function can be used to set which driver modules should be logged. The MongoLog module constants may be used with bitwise operators to specify multiple modules.

<?php

// first, specify a logging level
MongoLog::setLevel(MongoLog::ALL);

// log replica set activity
MongoLog::setModule(MongoLog::RS);

// log replica sets and connection activity
MongoLog::setModule(MongoLog::RS|MongoLog::CON);

// log everything except IO activity
MongoLog::setModule(MongoLog::ALL & (~MongoLog::IO));

?>

Note that you must also call MongoLog::setLevel() to enable logging.

参数

module

The module(s) you would like to log.

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/mongolog.setmodule.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3