php-doc-en/reference/mongo/mongolog/setmodule.xml
Kristina Chodorow 7e972c30de added MongoLog class
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@315037 c90b9560-bf6c-de11-be94-00142212c4b1
2011-08-16 21:12:29 +00:00

86 lines
2.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="mongolog.setmodule" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoLog::setModule</refname>
<refpurpose>Sets driver functionality to log</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <modifier>static</modifier> <type>void</type><methodname>MongoLog::setModule</methodname>
<methodparam><type>int</type><parameter>module</parameter></methodparam>
</methodsynopsis>
<para>
This function can be used to set which parts of the driver's functionality
should be logged. Use the constants described in the
<classname>MongoLog</classname> section with bitwise operators to specify
modules.
</para>
<programlisting role="php">
<![CDATA[
<?php
// first, turning up the logging level
MongoLog::setLevel(MongoLog::ALL);
// log replica set activity
MongoLog::setModule(MongoLog::RS);
// log replica sets and connection pooling
MongoLog::setModule(MongoLog::RS|MongoLog::ALL);
// log everything except IO activity
MongoLog::setModule(MongoLog::ALL & (~MongoLog::IO));
?>
]]>
</programlisting>
<para>
Note that you must also call <function>MongoLog::setLevel</function> to turn
on logging.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>module</parameter>
</term>
<listitem>
<para>
The module(s) you would like to log.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->