-
Notifications
You must be signed in to change notification settings - Fork 79
/
Copy pathopenlog.xml
242 lines (236 loc) · 8 KB
/
openlog.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: db22a7cfcbc3af221f67e228336ac3e2d62aaf2c 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>true</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.true.always;
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>8.2.0</entry>
<entry>
この関数は、常に &true; を返すようになりました。
これより前のバージョンでは、失敗時に &false; を返していました。
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</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
-->