mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-27 14:28:56 +00:00

Rewrite intro documentation and move PHP notice tip to a note block. Add MongoLog::CON. Add changelog, deprecating old constants. Fix modifiers for class properties. https://jira.mongodb.org/browse/PHP-1162 git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@334512 c90b9560-bf6c-de11-be94-00142212c4b1
347 lines
11 KiB
XML
347 lines
11 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
|
|
<phpdoc:classref xml:id="class.mongolog" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
|
|
|
|
<title>The MongoLog class</title>
|
|
<titleabbrev>MongoLog</titleabbrev>
|
|
|
|
<partintro>
|
|
|
|
<!-- {{{ MongoLog intro -->
|
|
<section xml:id="mongolog.intro">
|
|
&reftitle.intro;
|
|
<para>
|
|
Logging can be used to get detailed information about what the driver is
|
|
doing. Logging is disabled by default, but this class allows you to activate
|
|
specific levels of logging for various parts of the driver. Some examples:
|
|
</para>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
// print every log message possible
|
|
MongoLog::setLevel(MongoLog::ALL); // all log levels
|
|
MongoLog::setModule(MongoLog::ALL); // all parts of the driver
|
|
|
|
// print significant events about replica set failover
|
|
MongoLog::setLevel(MongoLog::INFO);
|
|
MongoLog::setModule(MongoLog::RS);
|
|
|
|
// print info- and diagnostic-level events for replica sets and connections
|
|
MongoLog::setLevel(MongoLog::INFO|MongoLog::FINE);
|
|
MongoLog::setModule(MongoLog::RS|MongoLog::CON);
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
<note>
|
|
<para>
|
|
By default, MongoLog emits all log messages as PHP notices. Depending
|
|
on the <acronym>SAPI</acronym> you use, messages may be sent to
|
|
<literal>stderr</literal> (for <acronym>CLI</acronym>) or the web server's
|
|
error log. If, after configuring MongoLog, log messages are not appearing
|
|
as expected, ensure that the <constant>E_NOTICE</constant> bit is included
|
|
in <link linkend="ini.error-reporting">error_reporting</link> and that
|
|
<link linkend="ini.display-errors">display_errors</link> is on.
|
|
</para>
|
|
</note>
|
|
</section>
|
|
<!-- }}} -->
|
|
|
|
<section xml:id="mongolog.synopsis">
|
|
&reftitle.classsynopsis;
|
|
|
|
<!-- {{{ Synopsis -->
|
|
<classsynopsis>
|
|
<ooclass><classname>MongoLog</classname></ooclass>
|
|
|
|
<!-- {{{ Class synopsis -->
|
|
<classsynopsisinfo>
|
|
<ooclass>
|
|
<classname>MongoLog</classname>
|
|
</ooclass>
|
|
</classsynopsisinfo>
|
|
<!-- }}} -->
|
|
|
|
<classsynopsisinfo role="comment">&Constants;</classsynopsisinfo>
|
|
<fieldsynopsis>
|
|
<modifier>const</modifier>
|
|
<type>int</type>
|
|
<varname linkend="mongolog.constants.none">MongoLog::NONE</varname>
|
|
<initializer>0</initializer>
|
|
</fieldsynopsis>
|
|
<fieldsynopsis>
|
|
<modifier>const</modifier>
|
|
<type>int</type>
|
|
<varname linkend="mongolog.constants.all">MongoLog::ALL</varname>
|
|
<initializer>31</initializer>
|
|
</fieldsynopsis>
|
|
|
|
<classsynopsisinfo role="levels">level constants</classsynopsisinfo>
|
|
<fieldsynopsis>
|
|
<modifier>const</modifier>
|
|
<type>int</type>
|
|
<varname linkend="mongolog.constants.warning">MongoLog::WARNING</varname>
|
|
<initializer>1</initializer>
|
|
</fieldsynopsis>
|
|
<fieldsynopsis>
|
|
<modifier>const</modifier>
|
|
<type>int</type>
|
|
<varname linkend="mongolog.constants.info">MongoLog::INFO</varname>
|
|
<initializer>2</initializer>
|
|
</fieldsynopsis>
|
|
<fieldsynopsis>
|
|
<modifier>const</modifier>
|
|
<type>int</type>
|
|
<varname linkend="mongolog.constants.fine">MongoLog::FINE</varname>
|
|
<initializer>4</initializer>
|
|
</fieldsynopsis>
|
|
|
|
<classsynopsisinfo role="levels">module constants</classsynopsisinfo>
|
|
<fieldsynopsis>
|
|
<modifier>const</modifier>
|
|
<type>int</type>
|
|
<varname linkend="mongolog.constants.rs">MongoLog::RS</varname>
|
|
<initializer>1</initializer>
|
|
</fieldsynopsis>
|
|
<fieldsynopsis>
|
|
<modifier>const</modifier>
|
|
<type>int</type>
|
|
<varname linkend="mongolog.constants.pool">MongoLog::POOL</varname>
|
|
<initializer>1</initializer>
|
|
</fieldsynopsis>
|
|
<fieldsynopsis>
|
|
<modifier>const</modifier>
|
|
<type>int</type>
|
|
<varname linkend="mongolog.constants.con">MongoLog::CON</varname>
|
|
<initializer>2</initializer>
|
|
</fieldsynopsis>
|
|
<fieldsynopsis>
|
|
<modifier>const</modifier>
|
|
<type>int</type>
|
|
<varname linkend="mongolog.constants.io">MongoLog::IO</varname>
|
|
<initializer>4</initializer>
|
|
</fieldsynopsis>
|
|
<fieldsynopsis>
|
|
<modifier>const</modifier>
|
|
<type>int</type>
|
|
<varname linkend="mongolog.constants.server">MongoLog::SERVER</varname>
|
|
<initializer>8</initializer>
|
|
</fieldsynopsis>
|
|
<fieldsynopsis>
|
|
<modifier>const</modifier>
|
|
<type>int</type>
|
|
<varname linkend="mongolog.constants.parse">MongoLog::PARSE</varname>
|
|
<initializer>16</initializer>
|
|
</fieldsynopsis>
|
|
|
|
<classsynopsisinfo role="comment">Fields</classsynopsisinfo>
|
|
<fieldsynopsis>
|
|
<modifier>private</modifier>
|
|
<modifier>static</modifier>
|
|
<type>int</type>
|
|
<varname>callback</varname>
|
|
</fieldsynopsis>
|
|
<fieldsynopsis>
|
|
<modifier>private</modifier>
|
|
<modifier>static</modifier>
|
|
<type>int</type>
|
|
<varname>level</varname>
|
|
</fieldsynopsis>
|
|
<fieldsynopsis>
|
|
<modifier>private</modifier>
|
|
<modifier>static</modifier>
|
|
<type>int</type>
|
|
<varname>module</varname>
|
|
</fieldsynopsis>
|
|
|
|
<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
|
|
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.mongolog')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
|
|
</classsynopsis>
|
|
<!-- }}} -->
|
|
|
|
</section>
|
|
|
|
<section>
|
|
&reftitle.constants;
|
|
<section xml:id="mongolog.constants.types">
|
|
<title>MongoLog Constants</title>
|
|
<para>
|
|
These constants can be used by both
|
|
<function>MongoLog::setLevel</function> and
|
|
<function>MongoLog::setModule</function>.
|
|
</para>
|
|
|
|
<variablelist>
|
|
<varlistentry xml:id="mongolog.constants.none">
|
|
<term><constant>MongoLog::NONE</constant></term>
|
|
<listitem>
|
|
<simpara>
|
|
Log nothing.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="mongolog.constants.all">
|
|
<term><constant>MongoLog::ALL</constant></term>
|
|
<listitem>
|
|
<simpara>
|
|
Log everything.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</section>
|
|
|
|
<section xml:id="mongolog.constants.level">
|
|
<title>MongoLog Level Constants</title>
|
|
<para>
|
|
These constants can be used by <function>MongoLog::setLevel</function>.
|
|
</para>
|
|
<variablelist>
|
|
<varlistentry xml:id="mongolog.constants.warning">
|
|
<term><constant>MongoLog::WARNING</constant></term>
|
|
<listitem>
|
|
<simpara>
|
|
Log events that are somewhat exceptional, but not quite worthy of an
|
|
actual exception (e.g. recoverable connection errors).
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="mongolog.constants.info">
|
|
<term><constant>MongoLog::INFO</constant></term>
|
|
<listitem>
|
|
<simpara>
|
|
Log events that may be of interest to administrators, but are not
|
|
particularly noteworthy (e.g. option parsing, authentication steps).
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="mongolog.constants.fine">
|
|
<term><constant>MongoLog::FINE</constant></term>
|
|
<listitem>
|
|
<simpara>
|
|
Log most events that the driver performs (e.g. server selection, socket
|
|
communication). Depending on the module being logged, this can be
|
|
extremely noisy and is primarily useful for debugging.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</section>
|
|
|
|
<section xml:id="mongolog.constants.module">
|
|
<title>MongoLog Module Constants</title>
|
|
<para>
|
|
These constants can be used by <function>MongoLog::setModule</function>.
|
|
</para>
|
|
<variablelist>
|
|
<varlistentry xml:id="mongolog.constants.con">
|
|
<term><constant>MongoLog::CON</constant></term>
|
|
<listitem>
|
|
<simpara>
|
|
Log connection activity. Creating new connections, authentication,
|
|
pinging, timeouts, etc.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="mongolog.constants.io">
|
|
<term><constant>MongoLog::IO</constant></term>
|
|
<listitem>
|
|
<simpara>
|
|
Log traffic to/from the database. Unless your program is trivial, this
|
|
will create an enormous number of log messages.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="mongolog.constants.parse">
|
|
<term><constant>MongoLog::PARSE</constant></term>
|
|
<listitem>
|
|
<simpara>
|
|
Log parsing of the connection string and options when constructing
|
|
<classname>MongoClient</classname>.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="mongolog.constants.pool">
|
|
<term><constant>MongoLog::POOL</constant></term>
|
|
<listitem>
|
|
<simpara>
|
|
Previously used to log connection pool activity. This option is now a
|
|
deprecated alias of <constant>MongoLog::RS</constant>.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="mongolog.constants.rs">
|
|
<term><constant>MongoLog::RS</constant></term>
|
|
<listitem>
|
|
<simpara>
|
|
Log replica set activity. Failovers, read preference selection, etc.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="mongolog.constants.server">
|
|
<term><constant>MongoLog::SERVER</constant></term>
|
|
<listitem>
|
|
<simpara>
|
|
Previously used to log server status changes. This option is deprecated
|
|
in favor of <constant>MongoLog::RS</constant>.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</section>
|
|
</section>
|
|
|
|
<section role="changelog">
|
|
&reftitle.changelog;
|
|
<para>
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>1.3.0</entry>
|
|
<entry>
|
|
Added <constant>MongoLog::CON</constant> and deprecated
|
|
<constant>MongoLog::POOL</constant> and
|
|
<constant>MongoLog::SERVER</constant>.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</section>
|
|
|
|
</partintro>
|
|
|
|
&reference.mongo.entities.mongolog;
|
|
|
|
</phpdoc:classref>
|
|
|
|
<!-- 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
|
|
-->
|