📄 syslog.3
字号:
.TH syslog 3.SH NAMEsyslog, openlog, closelog -- control system log.SH SYNOPSIS# include <syslog.h>.PPopenlog(ident, logstat).brchar *ident;.PPsyslog(priority, message, parameters ... ).brchar *message;.PPcloselog().SH DESCRIPTION.I Syslogwrites the.I messageto the program syslog(8)The message is tagged with priority.I priority.The message looks like a.I printf(3)string except that.B %mis replaced by the current error message(collected from.I errno\c).A trailing newline is added if needed.This message will be read by.I syslog(8)and output to the system console or files as appropriate..PPIf special processing is needed,.I openlogcan be called to initialize the log file.Parameters are.I identwhich is a string prepended to every message,and.I logstata bit field indicating special status;current values are:.IP LOG_PID \w'LOG_PID'u+3log the process id with each message:useful for identifying instantiations of daemons..LP.I Openlogreturns zero if it could create the socket.Otherwise, it arranges to write on /dev/consoleand returns -1.Calls to.I syslogcan still proceed,but any message with priority under.I LogMask (normally.BR LOG_CRIT )will be thrown away..PP.I Closelogcan be used to close the log socket..SH EXAMPLES.nfsyslog(LOG_SALERT, "who: internal error 23");.PPopenlog("serverftp", LOG_PID);syslog(LOG_INFO, "Connection from host %d", CallingHost);.fi.SH SEE\ ALSOsyslog(8)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -