略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: MongoLog::setLevel

2024-11-15

MongoLog::setLevel

(PECL mongo >= 1.2.3)

MongoLog::setLevelSets the level(s) to be logged

说明

public static MongoLog::setLevel ( int $level ) : void

This function can be used to control logging verbosity and the types of activities that should be logged. The MongoLog level constants may be used with bitwise operators to specify multiple levels.

<?php

// first, specify a logging module
MongoLog::setModule(MongoLog::CON);

// log messages for every level
MongoLog::setLevel(MongoLog::ALL);

// log warning and info messages only
MongoLog::setLevel(MongoLog::WARNING|MongoLog::INFO);

// log everything except fine activity
MongoLog::setLevel(MongoLog::ALL & (~MongoLog::FINE));

?>

Note that you must also call MongoLog::setModule() to specify which modules(s) of the driver should log.

参数

level

The level(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.setlevel.php

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