除了可接受的答案,了解以下内容也很有用...
这些功能中的每一个都应具有与其相关的手册页。
如果您运行man -k syslog
(手册页的关键字搜索),您将获得引用或有关syslog的手册页列表
$ man -k syslog
logger (1) - a shell command interface to the syslog(3) system l...
rsyslog.conf (5) - rsyslogd(8) configuration file
rsyslogd (8) - reliable and extended syslogd
syslog (2) - read and/or clear kernel message ring buffer; set c...
syslog (3) - send messages to the system logger
vsyslog (3) - send messages to the system logger
您需要了解手册部分才能进一步研究。
这是man手册页的摘录,其中解释了手册页的各个部分:
The table below shows the section numbers of the manual followed by
the types of pages they contain.
1 Executable programs or shell commands
2 System calls (functions provided by the kernel)
3 Library calls (functions within program libraries)
4 Special files (usually found in /dev)
5 File formats and conventions eg /etc/passwd
6 Games
7 Miscellaneous (including macro packages and conven‐
tions), e.g. man(7), groff(7)
8 System administration commands (usually only for root)
9 Kernel routines [Non standard]
阅读以上运行
$man man
因此,如果您运行该程序,man 3 syslog
则会获得syslog
在代码中调用的函数的完整手册页。
SYSLOG(3) Linux Programmer's Manual SYSLOG(3)
NAME
closelog, openlog, syslog, vsyslog - send messages to the system
logger
SYNOPSIS
#include <syslog.h>
void openlog(const char *ident, int option, int facility);
void syslog(int priority, const char *format, ...);
void closelog(void);
#include <stdarg.h>
void vsyslog(int priority, const char *format, va_list ap);
不是直接的答案,但希望您会发现这很有用。
/etc/
,您必须更改标识符("test"
针对您的情况)和工具。