Added info on mysqlnd.log_mask.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@303398 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Anthony Bedford 2010-09-15 14:34:29 +00:00
parent 7bd7f26bed
commit f1797f5f51

View file

@ -6,88 +6,167 @@
&extension.runtime;
<para>
<table>
<title>MySQL Native Driver Configuration Options</title>
<tgroup cols="4">
<thead>
<row>
<entry>Name</entry>
<entry>Default</entry>
<entry>Changeable</entry>
<entry>Changelog</entry>
</row>
</thead>
<tbody>
<row>
<entry><link linkend="mysqlnd.collect_statistics">mysqlnd.collect_statistics</link></entry>
<entry>"1"</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry>Available since PHP 5.3.0.</entry>
</row>
<row>
<entry><link linkend="mysqlnd.collect_memory_statistics">mysqlnd.collect_memory_statistics</link></entry>
<entry>"0"</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry>Available since PHP 5.3.0.</entry>
</row>
</tbody>
</tgroup>
</table>
&ini.php.constants;
</para>
<table>
<title>MySQL Native Driver Configuration Options</title>
<tgroup cols="4">
<thead>
<row>
<entry>Name</entry>
<entry>Default</entry>
<entry>Changeable</entry>
<entry>Changelog</entry>
</row>
</thead>
<tbody>
<row>
<entry><link linkend="mysqlnd.collect_statistics">mysqlnd.collect_statistics</link></entry>
<entry>"1"</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry>Available since PHP 5.3.0.</entry>
</row>
<row>
<entry><link linkend="mysqlnd.collect_memory_statistics">mysqlnd.collect_memory_statistics</link></entry>
<entry>"0"</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry>Available since PHP 5.3.0.</entry>
</row>
<row>
<entry><link linkend="mysqlnd.log_mask">mysqlnd.log_mask</link></entry>
<entry>"0"</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry>Available since PHP 5.3.0.</entry>
</row>
</tbody>
</tgroup>
</table>
&ini.php.constants;
</para>
&ini.descriptions.title;
<para>
<variablelist>
<varlistentry xml:id="mysqlnd.collect_statistics">
<term>
<parameter>mysqlnd.collect_statistics</parameter>
<type>boolean</type>
</term>
<listitem>
<para>
Enables the collection of various client statistics which can be
accessed through <function>mysqli_get_client_stats</function>,
<function>mysqli_get_connection_stats</function>,
<function>mysqli_get_cache_stats</function> and are shown in
<literal>mysqlnd</literal> section of the output of the
<function>phpinfo</function> function as well.
</para>
<para>
This configuration setting enables all
<link linkend="mysqlnd.stats">MySQL Native Driver statistics</link>
except those relating to memory management.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="mysqlnd.collect_memory_statistics">
<term>
<parameter>mysqlnd.collect_memory_statistics</parameter>
<type>boolean</type>
</term>
<listitem>
<para>
Enable the collection of various memory statistics which can be
accessed through <function>mysqli_get_client_stats</function>,
<function>mysqli_get_connection_stats</function>,
<function>mysqli_get_cache_stats</function> and are shown in
<literal>mysqlnd</literal> section of the output of the
<function>phpinfo</function> function as well.
</para>
<para>
This configuration setting enables the memory management statistics
within the overall set of <link linkend="mysqlnd.stats">MySQL Native
Driver statistics</link>.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<variablelist>
<varlistentry xml:id="mysqlnd.collect_statistics">
<term>
<parameter>mysqlnd.collect_statistics</parameter>
<type>boolean</type>
</term>
<listitem>
<para>
Enables the collection of various client statistics which can be
accessed through <function>mysqli_get_client_stats</function>,
<function>mysqli_get_connection_stats</function>,
<function>mysqli_get_cache_stats</function> and are shown in
<literal>mysqlnd</literal> section of the output of the
<function>phpinfo</function> function as well.
</para>
<para>
This configuration setting enables all
<link linkend="mysqlnd.stats">MySQL Native Driver
statistics</link> except those relating to memory management.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="mysqlnd.collect_memory_statistics">
<term>
<parameter>mysqlnd.collect_memory_statistics</parameter>
<type>boolean</type>
</term>
<listitem>
<para>
Enable the collection of various memory statistics which can be
accessed through <function>mysqli_get_client_stats</function>,
<function>mysqli_get_connection_stats</function>,
<function>mysqli_get_cache_stats</function> and are shown in
<literal>mysqlnd</literal> section of the output of the
<function>phpinfo</function> function as well.
</para>
<para>
This configuration setting enables the memory management
statistics within the overall set of
<link linkend="mysqlnd.stats">MySQL Native Driver
statistics</link>.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="mysqlnd.log_mask">
<term>
<parameter>mysqlnd.log_mask</parameter> <type>integer</type>
</term>
<listitem>
<para>
The PHP configuration setting <literal>mysqlnd.log_mask</literal>
defines which queries will be logged. The default is
mysqlnd.log_mask = "0", which disables logging.
</para>
<para>
This setting can have values assigned according to the following
table:
</para>
<informaltable>
<tgroup cols="2">
<tbody>
<row>
<entry>SERVER_STATUS_IN_TRANS</entry>
<entry>1</entry>
</row>
<row>
<entry>SERVER_STATUS_AUTOCOMMIT</entry>
<entry>2</entry>
</row>
<row>
<entry>SERVER_MORE_RESULTS_EXISTS</entry>
<entry>8</entry>
</row>
<row>
<entry>SERVER_QUERY_NO_GOOD_INDEX_USED</entry>
<entry>16</entry>
</row>
<row>
<entry>SERVER_QUERY_NO_INDEX_USED</entry>
<entry>32</entry>
</row>
<row>
<entry>SERVER_STATUS_CURSOR_EXISTS</entry>
<entry>64</entry>
</row>
<row>
<entry>SERVER_STATUS_LAST_ROW_SENT</entry>
<entry>128</entry>
</row>
<row>
<entry>SERVER_STATUS_DB_DROPPED</entry>
<entry>256</entry>
</row>
<row>
<entry>SERVER_STATUS_NO_BACKSLASH_ESCAPES</entry>
<entry>512</entry>
</row>
<row>
<entry>SERVER_QUERY_WAS_SLOW</entry>
<entry>1024</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>
It is possible to add the values together, to log multiple query
types. For example, you can set it to 16 + 32 = 48 to log slow
queries which either use no good index
(SERVER_QUERY_NO_GOOD_INDEX_USED = 16) or no index at all
(SERVER_QUERY_NO_INDEX_USED = 32).
</para>
<para>
Note, the SERVER_* constants are MySQL internal (C-level)
constants, not exported to the PHP userland. There are no
corresponding PHP constants. However, you can look up the values
in the table which has been created by inspecting the MySQL Native
Driver source.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</chapter>
<!-- Keep this comment at the end of the file
Local variables: