📄 syslog.8
字号:
.TH SYSLOG 8.SH NAMEsyslog \- log systems messages.SH SYNOPSIS/etc/syslog [.BI \-m N] [.BI \-f name].SH DESCRIPTION.I Syslogreads datagrams from an IPC port(currently port 2222, for no good reason)and logs each line it reads into a set of filesdescribed by the configuration file/etc/syslog.conf..I Syslogconfigures when it starts upand whenever it receives a hangup signal..PPEach message is one line.A message can contain a priority code,marked by a digit in angle bracesat the beginning of the line.Priorities are defined in <syslog.h>, as follows:.IP LOG_ALERT \w'LOG_WARNING'u+2nthis priority should essentially neverbe used. It applies only to messages thatare so important that every user should beaware of them, e.g., a serious hardware failure..IP LOG_SALERTmessages of this priority should beissued only when immediate attention is neededby a qualified system person, e.g., when somevaluable system resource dissappears. They getsent to a list of system people..IP LOG_EMERGEmergency messages are not sent to users,but represent major conditions. An examplemight be hard disk failures. These could belogged in a separate file so that criticalconditions could be easily scanned..IP LOG_ERRthese represent error conditions, such as softdisk failures, etc..IP LOG_CRITsuch messages contain critical information,but which can not be classed as errors, for example,'su' attempts.Messages of this priority and higherare typically logged on the system console..IP LOG_WARNINGissued when an abnormal condition has beendetected, but recovery can take place..IP LOG_NOTICEsomething that falls in the class of"important information"; this class is informationalbut important enough that you don't want to throwit away casually.Messages without any priority assigned to themare typically mapped into this priority..IP LOG_INFOinformation level messages. These messagescould be thrown away without problems, but shouldbe included if you want to keep a close watch onyour system..IP LOG_DEBUGit may be useful to log certain debugginginformation. Normally this will be thrown away..PPIt is expected that the kernel will not log anything belowLOG_ERR priority.(Note: kernel logging is not implemented at this time.).PPThe configuration file is in two sectionsseperated by a blank line.The first section defines files that.I syslogwill log into.Each line containsa single digit which defines the lowest priority(highest numbered priority)that this file will receive,an optional asteriskwhich guarantees that something gets outputat least every 20 minutes,and a pathname.The second part of the filecontains a list of users that will beinformed on SALERT level messages.For example, the configuration file:.nf 5*/dev/console 8/usr/spool/adm/syslog 3/usr/adm/critical eric kridle kalash.filogs all messages of priority 5 or higheronto the system console,including timing marks every 20 minutes;all messages of priority 8 or higherinto the file /usr/spool/adm/syslog;and all messages of priority 3 or higherinto /usr/adm/critical.The users ``eric'', ``kridle'', and ``kalash''will be informed on any subalert messages..PPThe flags are:.IP \-m 0.5iSet the mark interval to.I N(default 20 minutes)..IP \-fSpecify an alternate configuration file..IP \-dTurn on debugging (if compiled in)..PPTo bring.I syslogdown,it should be sent a terminate signal.It logs that it is going downand then waits approximately 30 secondsfor any additional messages to come in..PPThere are some special messages that cause control functions.``<*>N'' sets the default message priority to.I N.``<$>'' causes.I syslogto reconfigure(equivalent to a hangup signal).This can be used in a shell file run automaticallyearly in the morning to truncate the log..SH FILES/etc/syslog.conf \- the configuration file.SH BUGSLOG_ALERT and LOG_SUBALERT messagesshould only be allowed to privileged programs..PPActually,.I syslogis not clever enough to deal with kernel error messages..SH SEE\ ALSOsyslog(3)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -