8a72894489
Sync with the original version. Unify some japanese words. Submitted by: kano@na.rim.or.jp
292 lines
7.1 KiB
Groff
292 lines
7.1 KiB
Groff
.\" Copyright (c) 1985, 1991, 1993
|
|
.\" The Regents of the University of California. All rights reserved.
|
|
.\"
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
.\" modification, are permitted provided that the following conditions
|
|
.\" are met:
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
.\" must display the following acknowledgement:
|
|
.\" This product includes software developed by the University of
|
|
.\" California, Berkeley and its contributors.
|
|
.\" 4. Neither the name of the University nor the names of its contributors
|
|
.\" may be used to endorse or promote products derived from this software
|
|
.\" without specific prior written permission.
|
|
.\"
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
.\" SUCH DAMAGE.
|
|
.\"
|
|
.\" @(#)syslog.3 8.1 (Berkeley) 6/4/93
|
|
.\" $FreeBSD$
|
|
.\" %FreeBSD: src/lib/libc/gen/syslog.3,v 1.9.2.9 2001/12/14 18:33:51 ru Exp %
|
|
.\"
|
|
.Dd June 4, 1993
|
|
.Dt SYSLOG 3
|
|
.Os
|
|
.Sh ̾¾Î
|
|
.Nm syslog ,
|
|
.Nm vsyslog ,
|
|
.Nm openlog ,
|
|
.Nm closelog ,
|
|
.Nm setlogmask
|
|
.Nd ¥·¥¹¥Æ¥à¥í¥°¤ÎÀ©¸æ
|
|
.Sh ¥é¥¤¥Ö¥é¥ê
|
|
.Lb libc
|
|
.Sh ½ñ¼°
|
|
.In syslog.h
|
|
.In varargs.h
|
|
.Ft void
|
|
.Fn syslog "int priority" "const char *message" "..."
|
|
.Ft void
|
|
.Fn vsyslog "int priority" "const char *message" "va_list args"
|
|
.Ft void
|
|
.Fn openlog "const char *ident" "int logopt" "int facility"
|
|
.Ft void
|
|
.Fn closelog void
|
|
.Ft int
|
|
.Fn setlogmask "int maskpri"
|
|
.Sh ²òÀâ
|
|
.Fn syslog
|
|
´Ø¿ô¤Ï¡¢¥·¥¹¥Æ¥à¤Î¥á¥Ã¥»¡¼¥¸¥í¥¬¡¼¤Ë¥á¥Ã¥»¡¼¥¸¤ò½ñ¹þ¤ß¤Þ¤¹¡£
|
|
¤½¤Î¥á¥Ã¥»¡¼¥¸¤Ï¡¢¼¡¤Ë¾õ¶·¤Ë±þ¤¸¤Æ¥·¥¹¥Æ¥à¥³¥ó¥½¡¼¥ë¡¢¥í¥°¥Õ¥¡¥¤¥ë¡¢
|
|
¥í¥°¥¤¥ó¤·¤¿¥æ¡¼¥¶¤Ê¤É¤Ë½ñ¹þ¤Þ¤ì¤¿¤ê¡¢Â¾¤Î¥Þ¥·¥ó¤ËžÁ÷¤µ¤ì¤Þ¤¹
|
|
(
|
|
.Xr syslogd 8
|
|
»²¾È)
|
|
¡£
|
|
.Pp
|
|
¥á¥Ã¥»¡¼¥¸¤Ï¡¢
|
|
.Ql %m
|
|
¤¬¸½ºß¤Î¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤Ë¤è¤êÃÖ¤´¹¤¨¤é¤ì¤ë¤³¤È¤ò½ü¤±¤Ð¡¢
|
|
.Xr printf 3
|
|
¥Õ¥©¡¼¥Þ¥Ã¥È¥¹¥È¥ê¥ó¥°¤ÈƱ¤¸¤â¤Î¤Ë¤Ê¤ê¤Þ¤¹
|
|
(¥°¥í¡¼¥Ð¥ëÊÑ¿ô
|
|
errno
|
|
¤Ë¤è¤Ã¤Æ¼¨¤µ¤ì¤ë¤â¤Î¤ÈƱ¤¸¡£
|
|
.Xr strerror 3
|
|
»²¾È)
|
|
¡£
|
|
²¿¤â¤Ê¤¤¾ì¹ç¤Ï¡¢ËöÈø¤Ë²þ¹Ô¤¬Äɲ䵤ì¤Þ¤¹¡£
|
|
.Pp
|
|
.Fn vsyslog
|
|
´Ø¿ô¤Ï¡¢
|
|
.Xr stdarg 3
|
|
¤Î²ÄÊÑĹ°ú¿ôµ¡Ç½¤ò»È¤Ã¤Æ¤¹¤Ç¤Ë°ú¿ô¤¬
|
|
¥¥ã¥×¥Á¥ã¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤ÎÂåÂØ·Á¼°¤Ç¤¹¡£
|
|
.Pp
|
|
¥á¥Ã¥»¡¼¥¸¤Ë¤ÏÍ¥Àè½ç°Ì
|
|
(
|
|
.Fa priority
|
|
)
|
|
¤Î¥¿¥°¤¬ÉÕ¤±¤é¤ì¤Þ¤¹¡£Í¥Àè½ç°Ì¤Ï¡¢
|
|
.Fa facility
|
|
¤È
|
|
.Em level
|
|
¤Ë¥³¡¼¥É²½¤µ¤ì¤Þ¤¹¡£
|
|
.Fa facility
|
|
¤Ï¡¢¥á¥Ã¥»¡¼¥¸¤òºîÀ®¤¹¤ë
|
|
¥·¥¹¥Æ¥à¤Î°ìÉô¤òµ½Ò¤·¤Þ¤¹¡£
|
|
.Em level
|
|
¤Ï¡¢½çÈ֤ˤʤä¿
|
|
(¹â¤¤Êý¤«¤éÄ㤤Êý¤Ø)
|
|
¼¡¤Î¤è¤¦¤Ê°ìÍ÷¤«¤éÁªÂò¤·¤Þ¤¹¡§
|
|
.Bl -tag -width LOG_AUTHPRIV
|
|
.It Dv LOG_EMERG
|
|
¥Ñ¥Ë¥Ã¥¯¾õÂÖ¡£¤³¤ì¤Ï¡¢Ä̾ï¤ÏÁ´¥æ¡¼¥¶¤ËÁ÷¿®¤µ¤ì¤Þ¤¹¡£
|
|
.It Dv LOG_ALERT
|
|
²õ¤ì¤¿¥·¥¹¥Æ¥à¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¤è¤¦¤Ê¡¢Ä¾¤Á¤ËÀ§Àµ¤¹¤Ù¤¾õÂÖ¡£
|
|
.It Dv LOG_CRIT
|
|
´í¸±¤Ê¾õÂÖ¡¢Î㤨¤Ð¥Ï¡¼¥É¥Ç¥Ð¥¤¥¹¥¨¥é¡¼¤Ê¤É¡£
|
|
.It Dv LOG_ERR
|
|
¥¨¥é¡¼¡£
|
|
.It Dv LOG_WARNING
|
|
·Ù¹ð¥á¥Ã¥»¡¼¥¸¡£
|
|
.It Dv LOG_NOTICE
|
|
¥¨¥é¡¼¾õÂ֤ǤϤʤ¤¤¬¡¢ÆÃÊ̤˽èÍý¤¹¤ëɬÍ×À¤¬¹Í¤¨¤é¤ì¤ë¾õÂÖ¡£
|
|
.It Dv LOG_INFO
|
|
¥¤¥ó¥Õ¥©¥á¡¼¥·¥ç¥ó¥á¥Ã¥»¡¼¥¸¡£
|
|
.It Dv LOG_DEBUG
|
|
Ä̾ï¤Ï¥×¥í¥°¥é¥à¤Î¥Ç¥Ð¥Ã¥°¤ÎºÝ¤Ë¤Î¤ß»È¤¦¾ðÊó¤¬Æþ¤Ã¤¿
|
|
¥á¥Ã¥»¡¼¥¸¡£
|
|
.El
|
|
.Pp
|
|
.Fn openlog
|
|
´Ø¿ô¤Ï¡¢
|
|
.Fn syslog
|
|
¤ª¤è¤Ó
|
|
.Fn vsyslog
|
|
¤Ë¤è¤êÁ÷¤é¤ì¤¿¥á¥Ã¥»¡¼¥¸¤Ë
|
|
ÂФ·¤Æ¡¢¤è¤êÆüì¤Ê½èÍý¤ò»Ü¤¹¤¿¤á¤Î¤â¤Î¤Ç¤¹¡£¥Ñ¥é¥á¡¼¥¿
|
|
.Fa ident
|
|
¤Ï¡¢¤¹¤Ù¤Æ¤Î
|
|
¥á¥Ã¥»¡¼¥¸¤ÎÁ°¤ËÉղ䵤ì¤ë¥¹¥È¥ê¥ó¥°¤Ç¤¹¡£
|
|
.Fa logopt
|
|
°ú¿ô¤Ï¡¢¥í¥°ºîÀ®¥ª¥×¥·¥ç¥ó
|
|
¤ò»ØÄꤹ¤ë¥Ó¥Ã¥È¥Õ¥£¡¼¥ë¥É¤Ç¡¢¼¡¤Ë¼¨¤¹ÃͤÎ
|
|
1 ¤Ä°Ê¾å¤ò
|
|
.Tn OR
|
|
Áàºî¤¹¤ë¤³¤È¤Ë¤è¤Ã¤ÆºîÀ®¤µ¤ì¤Þ¤¹¡§
|
|
.Bl -tag -width LOG_AUTHPRIV
|
|
.It Dv LOG_CONS
|
|
.Fn syslog
|
|
¤¬¥á¥Ã¥»¡¼¥¸¤ò
|
|
.Xr syslogd 8
|
|
¤ØÅϤ»¤Ê¤¤¾ì¹ç¡¢
|
|
¥³¥ó¥½¡¼¥ë
|
|
.Pq Dq Pa /dev/console
|
|
¤Ë¥á¥Ã¥»¡¼¥¸¤ò½ñ¤¹þ¤à¤³¤È¤ò»î¤ß¤Þ¤¹¡£
|
|
.It Dv LOG_NDELAY
|
|
.Xr syslogd 8
|
|
¤Ø¤ÎÀܳ¤òľ¤Á¤Ë³«¤¤Þ¤¹¡£Ä̾ï¤Ï¡¢ºÇ½é¤Î
|
|
¥á¥Ã¥»¡¼¥¸¤¬¥í¥°¤Ë½ñ¹þ¤Þ¤ì¤ë¤Þ¤Ç¤Ï³«¤¯Áàºî¤òÃ٤餻¤Þ¤¹¡£¤³¤ì¤Ï¡¢
|
|
¥Õ¥¡¥¤¥ëµ½Ò»Ò¤ò³ä¤ê¿¶¤ë½çÈÖ¤ò´ÉÍý¤¹¤ëɬÍפ¬¤¢¤ë¥×¥í¥°¥é¥à¤Ç¤ÏÌò¤Ë
|
|
Ω¤Á¤Þ¤¹¡£
|
|
.It Dv LOG_PERROR
|
|
¥á¥Ã¥»¡¼¥¸¤ò¡¢¥·¥¹¥Æ¥à¥í¥°¤ÈƱ»þ¤Ëɸ½à¥¨¥é¡¼½ÐÎϤˤâ½ñ¹þ¤ß¤Þ¤¹¡£
|
|
.It Dv LOG_PID
|
|
³Æ¥á¥Ã¥»¡¼¥¸¤È¤È¤â¤Ë¥×¥í¥»¥¹
|
|
ID
|
|
¤ò¥í¥°¤·¤Þ¤¹¡£¥Ç¡¼¥â¥ó¤Î¥¤¥ó¥¹¥¿¥ó¥¹²½¤ò¼±Ê̤¹¤ë¤¿¤á¤ËÌò¤ËΩ¤Á¤Þ¤¹¡£
|
|
.El
|
|
.Pp
|
|
.Fa facility
|
|
¥Ñ¥é¥á¡¼¥¿¤Ï¡¢ÌÀ¼¨Åª¤Ê¥Õ¥¡¥·¥ê¥Æ¥£¤¬
|
|
¥³¡¼¥É²½¤µ¤ì¤Æ¤¤¤Ê¤¤¤¹¤Ù¤Æ¤Î¥á¥Ã¥»¡¼¥¸¤Ë³ä¤êÅö¤Æ¤ë¥Ç¥Õ¥©¥ë¥È¥Õ¥¡¥·¥ê¥Æ¥£¤ò
|
|
¥³¡¼¥É²½¤·¤Þ¤¹¡§
|
|
.Bl -tag -width LOG_AUTHPRIV
|
|
.It Dv LOG_AUTH
|
|
¸¢¸ÂÉÕÍ¿¥·¥¹¥Æ¥à¡§
|
|
.Xr login 1
|
|
¡¢
|
|
.Xr su 1
|
|
¡¢
|
|
.Xr getty 8
|
|
¡¢¤Ê¤É¡£
|
|
.It Dv LOG_AUTHPRIV
|
|
.Dv LOG_AUTH
|
|
¤ÈƱ¤¸¤Ç¤¹¤¬¡¢¸ÂÄꤵ¤ì¤¿¸Ä¿Í¤À¤±¤¬Æɤá¤ë
|
|
¥Õ¥¡¥¤¥ë¤Ë¥í¥°¤·¤Þ¤¹¡£
|
|
.It Dv LOG_CONSOLE
|
|
¥«¡¼¥Í¥ë¥³¥ó¥½¡¼¥ë½ÐÎϥɥ饤¥Ð¤¬¡¢¥á¥Ã¥»¡¼¥¸¤ò
|
|
.Pa /dev/console
|
|
¤Ë½ñ¤¹þ¤ß¤Þ¤¹¡£
|
|
.It Dv LOG_CRON
|
|
cron
|
|
¥Ç¡¼¥â¥ó¡§
|
|
.Xr cron 8
|
|
¡£
|
|
.It Dv LOG_DAEMON
|
|
.Xr routed 8
|
|
¤Î¤è¤¦¤Ê¡¢Â¾¤Î¥Õ¥¡¥·¥ê¥Æ¥£¤Ç¤ÏÌÀ¼¨Åª¤Ë
|
|
ÍÑ°Õ¤µ¤ì¤Æ¤¤¤Ê¤¤¥·¥¹¥Æ¥à¥Ç¡¼¥â¥ó¡£
|
|
.It Dv LOG_FTP
|
|
¥Õ¥¡¥¤¥ëžÁ÷¥×¥í¥È¥³¥ë¥Ç¡¼¥â¥ó¡§
|
|
.Xr ftpd 8
|
|
¡¢
|
|
.Xr tftpd 8
|
|
¡£
|
|
.It Dv LOG_KERN
|
|
¥«¡¼¥Í¥ë¤Ë¤è¤êÀ¸À®¤µ¤ì¤ë¥á¥Ã¥»¡¼¥¸¡£¤³¤ì¤é¤Ï¡¢¤É¤ó¤Ê
|
|
¥æ¡¼¥¶¥×¥í¥»¥¹¤Ë¤è¤Ã¤Æ¤âÀ¸À®¤Ç¤¤Þ¤»¤ó¡£
|
|
.It Dv LOG_LPR
|
|
¥é¥¤¥ó¥×¥ê¥ó¥¿¡¼¤Î¥¹¥×¡¼¥ê¥ó¥°¥·¥¹¥Æ¥à¡§
|
|
.Xr lpr 1
|
|
¡¢
|
|
.Xr lpc 8
|
|
¡¢
|
|
.Xr lpd 8
|
|
¡¢¤Ê¤É¡£
|
|
.It Dv LOG_MAIL
|
|
¥á¡¼¥ë¥·¥¹¥Æ¥à¡£
|
|
.It Dv LOG_NEWS
|
|
¥Í¥Ã¥È¥ï¡¼¥¯¥Ë¥å¡¼¥¹¥·¥¹¥Æ¥à¡£
|
|
.It Dv LOG_SECURITY
|
|
¥»¥¥å¥ê¥Æ¥£¥µ¥Ö¥·¥¹¥Æ¥à¤Ç¤¹¡£
|
|
Î㤨¤Ð
|
|
.Xr ipfw 4
|
|
¤Ç¤¹¡£
|
|
.It Dv LOG_SYSLOG
|
|
.Xr syslogd 8
|
|
¤Ë¤è¤êÆâÉôŪ¤ËÀ¸À®¤µ¤ì¤¿¥á¥Ã¥»¡¼¥¸¡£
|
|
.It Dv LOG_USER
|
|
Ǥ°Õ¤Î¥æ¡¼¥¶¥×¥í¥»¥¹¤Ë¤è¤êÀ¸À®¤µ¤ì¤¿¥á¥Ã¥»¡¼¥¸¡£²¿¤â
|
|
»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢¤³¤ì¤Ï¥Ç¥Õ¥©¥ë¥È¤Î¥Õ¥¡¥·¥ê¥Æ¥£¼±Ê̻Ҥˤʤê¤Þ¤¹¡£
|
|
.It Dv LOG_UUCP
|
|
uucp
|
|
¥·¥¹¥Æ¥à¡£
|
|
.It Dv LOG_LOCAL0
|
|
¥í¡¼¥«¥ë¤Î»ÈÍѤΤ¿¤á¤ËͽÌó¡£
|
|
.Dv LOG_LOCAL1
|
|
¤«¤é
|
|
.Dv LOG_LOCAL7
|
|
¤Þ¤Ç¤Ë¤Ä¤¤¤Æ¤âƱ¤¸¡£
|
|
.El
|
|
.Pp
|
|
.Fn closelog
|
|
´Ø¿ô¤Ï¡¢¥í¥°¥Õ¥¡¥¤¥ë¤òÊĤ¸¤ë¤¿¤á¤Ë»È¤¦¤³¤È¤¬¤Ç¤¤Þ¤¹¡£
|
|
.Pp
|
|
.Fn setlogmask
|
|
´Ø¿ô¤Ï¡¢¥í¥°Í¥Àè½ç°Ì¥Þ¥¹¥¯¤ò
|
|
.Fa maskpri
|
|
¤ËÀßÄꤷ¡¢°ÊÁ°¤Î¥Þ¥¹¥¯¤òÊÖ¤·¤Þ¤¹¡£
|
|
.Fa maskpri
|
|
¤ËÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤Í¥Àè½ç°Ì¤ò»ý¤Ã¤¿
|
|
.Fn syslog
|
|
¤Ø¤Î¸Æ¤Ó½Ð¤·¤ÏµñÀ䤵¤ì¤Þ¤¹¡£¸ÄÊ̤ÎÍ¥Àè½ç°Ì
|
|
.Fa pri
|
|
¤Î¤¿¤á¤Î¥Þ¥¹¥¯¤Ï¡¢¥Þ¥¯¥í
|
|
.Fn LOG_MASK pri
|
|
¤Ë¤è¤Ã¤Æ·×»»¤µ¤ì¤Þ¤¹¡£
|
|
.Fa toppri
|
|
¼«ÂΤò´Þ¤à
|
|
toppri
|
|
¤Þ¤Ç¤Î¤¹¤Ù¤Æ¤ÎÍ¥Àè½ç°Ì¤Ë¤Ä¤¤¤Æ¤Î¥Þ¥¹¥¯¤Ï¡¢¥Þ¥¯¥í
|
|
.Fn LOG_UPTO toppri
|
|
¤Ë¤è¤Ã¤ÆÍ¿¤¨¤é¤ì¤Þ¤¹¡£
|
|
¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¤¹¤Ù¤Æ¤ÎÍ¥Àè½ç°Ì¤ò¥í¥°¤¹¤ë¤³¤È¤òµö²Ä¤·¤Þ¤¹¡£
|
|
.Sh Ìá¤êÃÍ
|
|
¥ë¡¼¥Á¥ó
|
|
.Fn closelog
|
|
¡¢
|
|
.Fn openlog
|
|
¡¢
|
|
.Fn syslog
|
|
¡¢¤ª¤è¤Ó
|
|
.Fn vsyslog
|
|
¤Ï¡¢ÃͤòÊÖ¤·¤Þ¤»¤ó¡£
|
|
.Pp
|
|
¥ë¡¼¥Á¥ó
|
|
.Fn setlogmask
|
|
¤Ï¡¢¾ï¤ËÁ°¤Î¥í¥°¥Þ¥¹¥¯¥ì¥Ù¥ë¤òÊÖ¤·¤Þ¤¹¡£
|
|
.Sh Îã
|
|
.Bd -literal -offset indent
|
|
syslog(LOG_ALERT, "who: internal error 23");
|
|
|
|
openlog("ftpd", LOG_PID | LOG_NDELAY, LOG_FTP);
|
|
|
|
setlogmask(LOG_UPTO(LOG_ERR));
|
|
|
|
syslog(LOG_INFO, "Connection from host %d", CallingHost);
|
|
|
|
syslog(LOG_INFO|LOG_LOCAL2, "foobar error: %m");
|
|
.Ed
|
|
.Sh ´ØÏ¢¹àÌÜ
|
|
.Xr logger 1 ,
|
|
.Xr syslogd 8
|
|
.Sh Îò»Ë
|
|
¤³¤ì¤é¤Î´Ø¿ô¤Ï
|
|
.Bx 4.2
|
|
¤Ë¸½¤ì¤Þ¤·¤¿¡£
|