除了接受回答,知道以下內容很有用...
這些功能中的每一個都應該有手冊頁與它們相關聯。
如果運行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'')和設施。 –