1 .\" Written Feb 1994 by Steve Greenland (stevegr@neosoft.com)
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.
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.
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
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" Updated 1999.12.19 by Karl M. Hegbloom <karlheg@debian.org>
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>
34 .\" Japanese Verion Copyright (c) 1996 Shoichi OZAWA
35 .\" all right reserved.
36 .\" Translated Sep 1 20:14:01 JST 1996
37 .\" by Shoichi OZAWA <ozawa@omika.hitachi.co.jp>
38 .\" Updated Thu Oct 18 01:00:02 JST 2001
39 .\" by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
40 .\" Updated Fri Jan 4 22:15:21 JST 2002
41 .\" by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
42 .\" Updated 2002-04-14 by Kentaro Shirakata <argrath@ub32.org>
43 .\" Updated 2007-01-01 by Kentaro Shirakata <argrath@ub32.org>
45 .TH SYSLOG 3 2008-11-12 "Linux" "Linux Programmer's Manual"
47 .\"O closelog, openlog, syslog, vsyslog \- send messages to the system logger
49 closelog, openlog, syslog, vsyslog \- システムロガーにメッセージを送る
52 .B #include <syslog.h>
54 .BI "void openlog(const char *" ident ", int " option ", int " facility );
56 .BI "void syslog(int " priority ", const char *" format ", ...);"
58 .B "void closelog(void);"
60 .B #include <stdarg.h>
62 .BI "void vsyslog(int " priority ", const char *" format ", va_list " ap );
65 .\"O Feature Test Macro Requirements for glibc (see
66 .\"O .BR feature_test_macros (7)):
68 .RB ( feature_test_macros (7)
77 .\"O closes the descriptor being used to write to the system logger.
82 はシステムのログ記録用プログラム(システムロガー
89 .\"O opens a connection to the system logger for a program.
91 はログを出力しようとしているプログラムからログ記録用プログラムへの
93 .\"O The string pointed
96 .\"O is prepended to every message, and is typically set to the program name.
100 したプログラムの名前)はログ出力の一文一文に追加され、どのプログラム
101 が出力したログかを識別するために使われる。
104 .\"O argument specifies flags which control the operation of
106 .\"O and subsequent calls to
116 .\"O argument establishes a default to be used if
117 .\"O none is specified in subsequent calls to
122 を呼び出す際に facility が指定されなかった場合に使用される
128 .\"O are given below.
131 .\"O is optional; it will automatically be called by
133 .\"O if necessary, in which case
135 .\"O will default to NULL.
150 .\"O generates a log message, which will be distributed by
151 .\"O .BR syslogd (8).
158 .\"O argument is formed by ORing the
162 .\"O values (explained below).
173 .\"O The remaining arguments
178 .\"O and any arguments required by the
180 .\"O except that the two character sequence
182 .\"O will be replaced by
183 .\"O the error message string
184 .\"O .IR strerror ( errno ).
185 .\"O A trailing newline may be added if needed.
190 と似たスタイルの書式とその書式に与える値である。
202 .\"O performs the same task as
204 .\"O with the difference that it takes a set of arguments which have
205 .\"O been obtained using the
207 .\"O variable argument list macros.
211 と同じ機能を持つが、可変引き数リストを指定することができる点が異なる。
214 可変引き数リストマクロを用いて取得される。
216 .\"O The subsections below list the parameters used to set the values of
217 .\"O .IR option , " facility" ", and " priority .
223 .\"O is an OR of any of these:
230 の値を設定するのに使用されるパラメータを説明する。
239 .\"O Write directly to system console if there is an error while sending to
241 エラーがあれば、システムロガーに送る一方でシステムコンソールにも直接書く。
244 .\"O Open the connection immediately (normally, the connection is opened when
245 .\"O the first message is logged).
246 ログ記録用プログラムとの接続を即座に開始する
247 (通常は、最初のメッセージが記録される時に接続を開く)。
250 .\"O Don't wait for child processes that may have been created while logging
252 .\"O (The GNU C library does not create a child process, so this
253 .\"O option has no effect on Linux.)
254 メッセージを記録する際に生成される子プロセスの終了を待たない。
255 (GNU C ライブラリは子プロセスを生成しない。
256 したがって、このオプションは Linux では無効である。)
260 .\"O .BR LOG_NDELAY ;
261 .\"O opening of the connection is delayed until
264 .\"O (This is the default, and need not be specified.)
269 (このオプションはデフォルトであり、特に指定する必要はない。)
272 .\"O (Not in POSIX.1-2001.)
273 .\"O Print to stderr as well.
274 stderr にも出力する。(POSIX.1-2001 では定義されていない)
277 .\"O Include PID with each message.
283 .\"O argument is used to specify what type of program is logging the message.
284 .\"O This lets the configuration file specify that messages from different
285 .\"O facilities will be handled differently.
287 引き数はメッセージに記録されるプログラムのタイプを指定するために使われる。
288 これによって異なるタイプのプログラムからのメッセージは異なる扱いを
294 .\"O security/authorization messages (DEPRECATED Use
303 .\"O security/authorization messages (private)
304 セキュリティ/認証 メッセージ (プライベート)
308 .\"O .RB ( cron " and " at )
315 .\"O system daemons without separate facility value
316 特定の facility 値を持たないシステムデーモン
323 .\"O kernel messages (these can't be generated from user processes)
324 カーネルメッセージ (ユーザプロセスから生成することはできない)
325 .\" LOG_KERN has the value 0; if used as a facility, zero translates to:
326 .\" "use the default facility".
328 .\"O .BR LOG_LOCAL0 " through " LOG_LOCAL7
329 .\"O reserved for local use
330 .BR LOG_LOCAL0 " から " LOG_LOCAL7
334 .\"O line printer subsystem
342 .\"O USENET news subsystem
346 .\"O messages generated internally by
351 .\"O .BR LOG_USER " (default)"
352 .BR LOG_USER " (デフォルト)"
353 .\"O generic user-level messages
360 .\"O This determines the importance of the message.
361 .\"O The levels are, in order of decreasing importance:
363 優先度の高いものから低いものの順で下記する。
366 .\"O system is unusable
370 .\"O action must be taken immediately
374 .\"O critical conditions
378 .\"O error conditions
382 .\"O warning conditions
386 .\"O normal, but significant, condition
390 .\"O informational message
394 .\"O debug-level message
398 .\"O .BR setlogmask (3)
399 .\"O can be used to restrict logging to specified levels only.
402 指定されたレベルのメッセージだけを記録するように
404 .\"O .SH "CONFORMING TO"
408 .\"O .BR closelog (),
413 .\"O are specified in SUSv2 and POSIX.1-2001.
417 は SUSv2 と POSIX.1-2001 で規定されている
421 .\"O POSIX.1-2001 specifies only the
434 .\"O However, with the exception of
440 .\"O values appear on most UNIX systems.
448 の値は多くの UNIX システムで使われている。
453 .\"O is not specified by POSIX.1-2001, but is available
454 .\"O in most versions of UNIX.
458 の値は、 POSIX.1-2001 では規定されていないが、
459 UNIX の多くのバージョンで使用可能である。
463 .\"O .\" .BR syslog ()
464 .\"O .\" function call appeared in 4.2BSD.
466 .\" ファンクション・コールは 4.2BSD から実装された。
467 .\"O .\" 4.3BSD documents
468 .\"O .\" .BR openlog (),
469 .\"O .\" .BR syslog (),
470 .\"O .\" .BR closelog (),
472 .\"O .\" .BR setlogmask ().
477 .\" .BR setlogmask ()
479 .\"O .\" 4.3BSD-Reno also documents
480 .\"O .\" .BR vsyslog ().
481 .\" また、4.3BSD-Reno には
484 .\"O .\" Of course early v* functions used the
485 .\"O .\" .I <varargs.h>
486 .\"O .\" mechanism, which is not compatible with
487 .\"O .\" .IR <stdarg.h> .
499 .\"O is probably stored as-is.
503 引き数は、値がそのまま保持されていることを前提にしている。
504 .\"O Thus, if the string it points to
507 .\"O may start prepending the changed string, and if the string
508 .\"O it points to ceases to exist, the results are undefined.
514 指定された文字列が存在しなくなった場合、結果は未定義である。
515 .\"O Most portable is to use a string constant.
516 最も移植性がある方法は、文字列定数を使用することである。
518 .\"O Never pass a string with user-supplied data as a format,
519 .\"O use the following instead:
520 ユーザーから与えられたデータを format として渡してはならない。
524 syslog(priority, "%s", string);