OSDN Git Service

(split) LDP: Update ja.po (editorical changes only)
[linuxjm/LDP_man-pages.git] / draft / man3 / syslog.3
1 .\" Written  Feb 1994 by Steve Greenland (stevegr@neosoft.com)
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" Updated 1999.12.19 by Karl M. Hegbloom <karlheg@debian.org>
24 .\"
25 .\" Updated 13 Oct 2001, Michael Kerrisk <mtk.manpages@gmail.com>
26 .\"     Added description of vsyslog
27 .\"     Added descriptions of LOG_ODELAY and LOG_NOWAIT
28 .\"     Added brief description of facility and option arguments
29 .\"     Added CONFORMING TO section
30 .\" 2001-10-13, aeb, minor changes
31 .\" Modified 13 Dec 2001, Martin Schulze <joey@infodrom.org>
32 .\" Modified 3 Jan 2002, Michael Kerrisk <mtk.manpages@gmail.com>
33 .\"
34 .\"*******************************************************************
35 .\"
36 .\" This file was generated with po4a. Translate the source file.
37 .\"
38 .\"*******************************************************************
39 .TH SYSLOG 3 2012\-04\-30 Linux "Linux Programmer's Manual"
40 .SH 名前
41 closelog, openlog, syslog, vsyslog \- システムロガーにメッセージを送る
42 .SH 書式
43 \fB#include <syslog.h>\fP
44 .sp
45 \fBvoid openlog(const char *\fP\fIident\fP\fB, int \fP\fIoption\fP\fB, int
46 \fP\fIfacility\fP\fB);\fP
47 .br
48 \fBvoid syslog(int \fP\fIpriority\fP\fB, const char *\fP\fIformat\fP\fB, ...);\fP
49 .br
50 \fBvoid closelog(void);\fP
51 .sp
52 \fB#include <stdarg.h>\fP
53 .sp
54 \fBvoid vsyslog(int \fP\fIpriority\fP\fB, const char *\fP\fIformat\fP\fB, va_list
55 \fP\fIap\fP\fB);\fP
56 .sp
57 .in -4n
58 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
59 .in
60 .sp
61 \fBvsyslog\fP(): _BSD_SOURCE
62 .SH 説明
63 \fBcloselog\fP()  はシステムのログ記録用プログラム(システムロガー \fBsyslogd\fP(8))  ヘの接続を終了する。
64 \fBcloselog\fP()  は必須ではない。
65 .sp
66 \fBopenlog\fP() はログを出力しようとしているプログラムからログ記録用
67 プログラム (system logger) への 接続を開始する。
68 \fIident\fP で指定した文字列は各メッセージの前に付与される。
69 通常は \fIident\fP にはプログラム名が設定される。
70 \fIident\fP が NULL の場合、プログラムが \fIident\fP として使用される
71 (POSIX.1\-2008 では \fIident\fP が NULL の場合の動作は規定されていない)。
72
73 \fIoption\fP 引き数は、 \fBopenlog\fP() の動作とその後の \fBsyslog\fP() の呼び
74 出しを制御するフラグを指定する。 \fIfacility\fP 引き数は、後で \fBsyslog\fP()
75 を呼び出す際に facility が指定されなかった場合に使用される デフォルト値
76 を決定する。 \fIoption\fP と \fIfacility\fP については後述する。
77 \fBopenlog\fP() は必須ではなく、必要に応じて \fBsyslog\fP() から呼び出される。
78 \fBsyslog\fP() が呼び出した場合、 \fIident\fP のデフォルト値は NULL になる。
79 .sp
80 \fBsyslog\fP()  はログメッセージを出力し、 \fBsyslogd\fP(8)  がそのメッセージを記録する。 \fIpriority\fP 引き数は
81 \fIfacility\fP と \fIlevel\fP との組合せで指定する。 \fIfacility\fP と \fIlevel\fP の取りうる値は後述する。 残りの
82 \fIformat\fP 引き数は \fBprintf\fP(3)  と似たスタイルの書式とその書式に与える値である。 \fIformat\fP 中の2文字 \fB%m\fP
83 はその時点での \fIerrno\fP に関連するエラーメッセージ文字列 (\fIstrerror\fP)  によって置き換えられる。
84 必要な場合は末尾に改行が加えられる。
85
86 \fBvsyslog\fP()  関数は \fBsyslog\fP()  と同じ機能を持つが、可変引き数リストを指定することができる点が異なる。
87 指定された引き数は、 \fBstdarg\fP(3)  可変引き数リストマクロを用いて取得される。
88
89 以下のサブセクションでは、 \fIoption\fP と \fIfacility\fP と \fIpriority\fP
90 の値を設定するのに使用されるパラメータを説明する。
91 .SS option
92 下記の値を OR したものが \fBopenlog\fP()  の \fIoption\fP 引き数になる:
93 .TP  15
94 \fBLOG_CONS\fP
95 エラーがあれば、システムロガーに送る一方でシステムコンソールにも直接書く。
96 .TP 
97 \fBLOG_NDELAY\fP
98 ログ記録用プログラムとの接続を即座に開始する (通常は、最初のメッセージが記録される時に接続を開く)。
99 .TP 
100 \fBLOG_NOWAIT\fP
101 メッセージを記録する際に生成される子プロセスの終了を待たない。 (GNU C ライブラリは子プロセスを生成しない。 したがって、このオプションは
102 Linux では無効である。)
103 .TP 
104 \fBLOG_ODELAY\fP
105 \fBLOG_NDELAY\fP の反対。 \fBsyslog\fP()  が呼ばれるまで、接続の開始を行わない。
106 (このオプションはデフォルトであり、特に指定する必要はない。)
107 .TP 
108 \fBLOG_PERROR\fP
109 stderr にも出力する。
110 (POSIX.1\-2001 と POSIX.1\-2008 では定義されていない)
111 .TP 
112 \fBLOG_PID\fP
113 個々のメッセージに PID を含める。
114 .SS facility
115 \fIfacility\fP 引き数はメッセージに記録されるプログラムのタイプを指定するために使われる。
116 これによって異なるタイプのプログラムからのメッセージは異なる扱いを するように設定ファイル( \fBsyslog.conf\fP(5))  に定義できる。
117 .TP  15
118 \fBLOG_AUTH\fP
119 セキュリティ/認証 メッセージ (非推奨。代わりに \fBLOG_AUTHPRIV\fP を使用すること)
120 .TP 
121 \fBLOG_AUTHPRIV\fP
122 セキュリティ/認証 メッセージ (プライベート)
123 .TP 
124 \fBLOG_CRON\fP
125 クロックデーモン (\fBcron\fP と at\fB)\fP
126 .TP 
127 \fBLOG_DAEMON\fP
128 特定の facility 値を持たないシステムデーモン
129 .TP 
130 \fBLOG_FTP\fP
131 ftp デーモン
132 .TP 
133 \fBLOG_KERN\fP
134 .\" LOG_KERN has the value 0; if used as a facility, zero translates to:
135 .\" "use the default facility".
136 カーネルメッセージ (ユーザプロセスから生成することはできない)
137 .TP 
138 \fBLOG_LOCAL0\fP から \fBLOG_LOCAL7\fP
139 ローカルな使用のためにリザーブされている
140 .TP 
141 \fBLOG_LPR\fP
142 ラインプリンタ・サブシステム
143 .TP 
144 \fBLOG_MAIL\fP
145 メール・サブシステム
146 .TP 
147 \fBLOG_NEWS\fP
148 USENET ニュース・サブシステム
149 .TP 
150 \fBLOG_SYSLOG\fP
151 \fBsyslogd\fP(8)  によって内部的に発行されるメッセージ
152 .TP 
153 \fBLOG_USER\fP (デフォルト)
154 一般的なユーザレベルメッセージ
155 .TP 
156 \fBLOG_UUCP\fP
157 UUCPサブシステム
158 .SS level
159 これはメッセージの優先度を指定する。 優先度の高いものから低いものの順で下記する。
160 .TP  15
161 \fBLOG_EMERG\fP
162 システムが使用不可
163 .TP 
164 \fBLOG_ALERT\fP
165 直ちに行動を起こさなければならない
166 .TP 
167 \fBLOG_CRIT\fP
168 危険な状態
169 .TP 
170 \fBLOG_ERR\fP
171 エラーの状態
172 .TP 
173 \fBLOG_WARNING\fP
174 ワーニングの状態
175 .TP 
176 \fBLOG_NOTICE\fP
177 通常だが重要な状態
178 .TP 
179 \fBLOG_INFO\fP
180 インフォメーションメッセージ
181 .TP 
182 \fBLOG_DEBUG\fP
183 デバッグレベルのメッセージ
184 .LP
185 \fBsetlogmask\fP(3)  関数を使用して、 指定されたレベルのメッセージだけを記録するように 制限することができる。
186 .SH 準拠
187 .\" .SH HISTORY
188 .\" A
189 .\" .BR syslog ()
190 .\" function call appeared in 4.2BSD.
191 .\" 4.3BSD documents
192 .\" .BR openlog (),
193 .\" .BR syslog (),
194 .\" .BR closelog (),
195 .\" and
196 .\" .BR setlogmask ().
197 .\" 4.3BSD-Reno also documents
198 .\" .BR vsyslog ().
199 .\" Of course early v* functions used the
200 .\" .I <varargs.h>
201 .\" mechanism, which is not compatible with
202 .\" .IR <stdarg.h> .
203 \fBopenlog\fP(), \fBcloselog\fP(), \fBsyslog\fP() は SUSv2, POSIX.1\-2001,
204 POSIX.1\-2008 で規定されている (但し \fBvsyslog\fP() は除く)。
205 POSIX.1\-2001 では \fIfacility\fP として \fBLOG_USER\fP と \fBLOG_LOCAL*\fP の値
206 が規定されているだけである。 しかしながら、 \fBLOG_AUTHPRIV\fP と
207 \fBLOG_FTP\fP という例外はあるが、 それ以外の \fIfacility\fP の値は多くの
208 UNIX システムで使われている。 \fIoption\fP の値の \fBLOG_PERROR\fP の値は、
209 POSIX.1\-2001 と POSIX.1\-2008 では規定されていないが、
210 UNIX の多くのバージョンで使用可能である。
211 .SH 注意
212 \fBopenlog\fP()  呼び出しの \fIident\fP 引き数は、値がそのまま保持されていることを前提にしている。 それゆえ、 \fIident\fP
213 で指定された文字列が変更されると、 \fBsyslog\fP()  は変更された文字列の追加するだろうし、
214 指定された文字列が存在しなくなった場合、結果は未定義である。 最も移植性がある方法は、文字列定数を使用することである。
215 .LP
216 ユーザーから与えられたデータを format として渡してはならない。 代わりに以下を使うこと。
217 .nf
218
219     syslog(priority, "%s", string);
220 .fi
221 .SH 関連項目
222 \fBlogger\fP(1), \fBsetlogmask\fP(3), \fBsyslog.conf\fP(5), \fBsyslogd\fP(8)
223 .SH この文書について
224 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.41 の一部
225 である。プロジェクトの説明とバグ報告に関する情報は
226 http://www.kernel.org/doc/man\-pages/ に書かれている。