📄 syslog.8
字号:
.\" SCCSID: @(#)syslog.8 8.1 9/11/90.TH syslog 8.\" @(#)syslog.8 4.2 7/28/83.SH Namesyslog \- log systems messages.SH Syntax/etc/syslog [.BI \-m N] [.BI \-f name] [.B \-d].SH Description.NXR "syslog command".NXR "system" "logging message".NXAM "syslog subroutine" "syslog command"The.PN syslogcommand reads a datagram socketand logs each line it reads into a set of filesdescribed by the configuration file.PN /etc/syslog.conf .The.PN syslogcommand configures 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:.NXR "syslog command" "priority code list".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, for example, a serious hardware failure..IP LOG_SALERTMessages of this priority should beissued only when immediate attention is neededby a qualified system person, for example, when somevaluable system resource disappears. These messages aresent 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 messages 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_WARNINGThese messages are issued when an abnormal condition has beendetected, but recovery can take place..IP LOG_NOTICEThese messages fall into 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_INFOThese are information level messages. These messagescould be thrown away without problems, but shouldbe included if you want to keep a close watch onyour system..IP LOG_DEBUGThese messages may be useful to log certain debugginginformation. Normally this information is thrown away..PPIt is expected that the kernel will not log anything belowLOG_ERR priority..PPThe configuration file is in two sectionsseparated by a blank line.The first section defines files that.PN 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 following logs all messages of priority 5 or higheronto the system console,including timing marks every 20 minutes:.NXR "configuration file (syslog)" "format".EX5*/dev/console8/usr/spool/adm/syslog3/usr/adm/criticalerickridlekalash.EEThis example logs all messages of priority 8 or higherinto the file .PN /usr/spool/adm/syslog;and all messages of priority 3 or higherinto .PN /usr/adm/critical .The users ``eric'', ``kridle'', and ``kalash''will be informed on any subalert messages..PPThe flags are:.NXR "syslog command" "options".TP 0.5i.B \-mSet the mark interval to.I N(default 20 minutes)..TP.B \-fSpecify an alternate configuration file..TP.B \-dTurn on debugging (if compiled in)..PPTo bring.PN 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.PN syslogto reconfigure(equivalent to a hangup signal).This can be used in a shell file run automaticallyearly in the morning to truncate the log..PPThe.PN syslogcommand creates the file .PN /etc/syslog.pidif possible containing a single line with its process ID.This can be used to kill or reconfigure.PN syslog ..\".PP.\"The.\".PN syslog.\"command.\"can also be compiled to use.\".MS mpx 2.\"files instead of datagrams.\"if you are running V7..\"In this case it creates and reads the file.\".PN /dev/log..SH Restrictions.NXR "syslog command" "restricted"LOG_ALERT and LOG_SUBALERT messagesshould only be allowed to privileged programs..PPActually,.PN syslogcan not deal with kernel error messagesin the current implementation..SH Files.TP 17.PN /etc/syslog.conf Configuration file.TP.PN /etc/syslog.pid Process id.\".TP.\".PN /dev/log .\"Under V7, the mpx file.SH See\ Alsosyslog(3)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -