1
0
mirror of https://github.com/php/doc-ja.git synced 2026-03-27 16:42:17 +01:00
Files
archived-doc-ja/reference/network/functions/openlog.xml
2020-12-27 04:34:12 +00:00

220 lines
7.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 0c9c2dd669fe9395eaa73d487fbd160f9057429a Maintainer: hirokawa Status: ready -->
<!-- CREDITS: takagi,mumumu -->
<refentry xml:id="function.openlog" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>openlog</refname>
<refpurpose>システムのロガーへの接続をオープンする</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>openlog</methodname>
<methodparam><type>string</type><parameter>prefix</parameter></methodparam>
<methodparam><type>int</type><parameter>flags</parameter></methodparam>
<methodparam><type>int</type><parameter>facility</parameter></methodparam>
</methodsynopsis>
<para>
<function>openlog</function> は、プログラムによるシステムロガーへの接続をオープンします。
</para>
<para>
<function>openlog</function> の使用は必須ではありません。この関数は、
必要に応じて <function>syslog</function> により自動的に呼び出されます。
この場合、<parameter>prefix</parameter> のデフォルト値は
&false; となります。
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>prefix</parameter></term>
<listitem>
<para>
文字列 <parameter>prefix</parameter> が、各メッセージに追加されます。
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>flags</parameter></term>
<listitem>
<para>
<parameter>flags</parameter> 引数は、
ログメッセージの生成時に使用されるロギング用オプションを指定します。
<table>
<title><function>openlog</function> のオプション</title>
<tgroup cols="2">
<thead>
<row>
<entry>定数</entry>
<entry>説明</entry>
</row>
</thead>
<tbody>
<row>
<entry><constant>LOG_CONS</constant></entry>
<entry>
システムロガーにデータが送信される間にエラーが発生した場合、
直接、システムコンソールに書き込まれます。
</entry>
</row>
<row>
<entry><constant>LOG_NDELAY</constant></entry>
<entry>
直ちにロガーへの接続をオープンします。
</entry>
</row>
<row>
<entry><constant>LOG_ODELAY</constant></entry>
<entry>
(デフォルト) 最初のメッセージがロギングされるまで接続のオープンを遅延します。
</entry>
</row>
<row>
<entry><constant>LOG_PERROR</constant></entry>
<entry>標準エラー出力にもログメッセージを出力します。</entry>
</row>
<row>
<entry><constant>LOG_PID</constant></entry>
<entry>各メッセージに PID も含めます。</entry>
</row>
</tbody>
</tgroup>
</table>
これらのオプションを一つまたは複数設定することが可能です。
複数のオプションを使用する場合、その論理和を指定します。
つまり、直ちに接続をオープンし、コンソールに書き込み、
各メッセージに PID を含めるには、
<literal>LOG_CONS | LOG_NDELAY | LOG_PID</literal>
とします。
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>facility</parameter></term>
<listitem>
<para>
引数 <parameter>facility</parameter> には、
ロギングを行う際のメッセージ型を指定します。これにより、
(使用するシステムの syslog の設定に関して) 異なった facility
を有するメッセージをどのように処理するかを指定できるようになります。
<table>
<title><function>openlog</function> の機能</title>
<tgroup cols="2">
<thead>
<row>
<entry>定数</entry>
<entry>説明</entry>
</row>
</thead>
<tbody>
<row>
<entry><constant>LOG_AUTH</constant></entry>
<entry>
セキュリティ/認証用メッセージ
(定数 <constant>LOG_AUTHPRIV</constant>
が定義されているシステムでは、代わりにそれを使用してください)
</entry>
</row>
<row>
<entry><constant>LOG_AUTHPRIV</constant></entry>
<entry>セキュリティ/認証 メッセージ (プライベート)</entry>
</row>
<row>
<entry><constant>LOG_CRON</constant></entry>
<entry>クロックデーモン (cron や at)</entry>
</row>
<row>
<entry><constant>LOG_DAEMON</constant></entry>
<entry>他のシステムデーモン</entry>
</row>
<row>
<entry><constant>LOG_KERN</constant></entry>
<entry>カーネルメッセージ</entry>
</row>
<row>
<entry><constant>LOG_LOCAL0</constant> ... <constant>LOG_LOCAL7</constant></entry>
<entry>ローカルでの使用のために確保されているもので、Windows では使用できません</entry>
</row>
<row>
<entry><constant>LOG_LPR</constant></entry>
<entry>ラインプリンタサブシステム</entry>
</row>
<row>
<entry><constant>LOG_MAIL</constant></entry>
<entry>メールサブシステム</entry>
</row>
<row>
<entry><constant>LOG_NEWS</constant></entry>
<entry>USENET ニュース サブシステム</entry>
</row>
<row>
<entry><constant>LOG_SYSLOG</constant></entry>
<entry>syslogd で内部的に生成されたメッセージ</entry>
</row>
<row>
<entry><constant>LOG_USER</constant></entry>
<entry>一般的なユーザーレベルのメッセージ</entry>
</row>
<row>
<entry><constant>LOG_UUCP</constant></entry>
<entry>UUCP サブシステム</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
<note>
<para>
Windows 環境で使用できるのは <literal>LOG_USER</literal> だけです。
</para>
</note>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>syslog</function></member>
<member><function>closelog</function></member>
</simplelist>
</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
-->