📄 syslog.3
字号:
.\" SCCSID: @(#)syslog.3 8.2 1/28/91.TH syslog 3.SH Namesyslog, openlog, closelog \- control system log.SH Syntax.B "#include <syslog.h>.PP.B "openlog(ident, logstat).br.B "char *ident;.PP.B "void syslog(priority, message, parameters ... ).br.B "char *message;.PP.B "void closelog().SH Description.NXR "syslog subroutine".NXR "openlog subroutine".NXR "closelog subroutine".NXR "system log" "controlling"The.PN syslogsubroutine arranges to write the message onto the system log maintained by.MS syslog 8 .The message is tagged with priority and it looks like a.MS printf 3sstring except that .B %mis replaced by the current error message (collected from.PN errno ).A trailing new line is added if needed.This message is read by.MS syslog 8and output to the system console or files as appropriate.The maximum number of parameters is 5..PPIf special processing is needed,.PN openlogcan be called to initialize the log file.Parameters are.I identwhich is prepended to every message, and.I logstatwhich is a bit field indicating special status; current values are:.IP LOG_PID 9log the process id with each message;useful for identifying daemons..PPThe.PN openlogreturns zero on success.If it cannot open the file .PN /dev/log ,it writes on .PN /dev/consoleinstead and returns \-1..PPThe.PN closelogcan be used to close the log file..SH Examples.EX syslog(LOG_SALERT, "who: internal error 23");openlog("serverftp", LOG_PID);syslog(LOG_INFO, "Connection from host %d", CallingHost);.EE.SH See Alsosyslog(8)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -