我正在通过一些syslog-ng文档阅读,并在有关过滤function的部分,它说, program()filter匹配…
…消息通过使用正则expression式对日志消息的程序名称字段。
该文档还包含其他filterfunction的类似定义。
日志消息中的程序名称字段如何设置? 是否有一些文件介绍了各个领域的情况? 我在我的文档(“syslog-ngpipe理员指南”)中找不到它。
程序名称字段由发送日志消息的应用程序设置。 如果由于某种原因想要覆盖它,可以使用syslog-ng源定义中的program_override()选项。 我不知道哪个syslog-ng版本支持这个选项,它肯定在3.0及更高版本中可用。
HTH
罗伯特
从man 3 syslog :
(...) #include <syslog.h> void openlog(const char *ident, int option, int facility); void syslog(int priority, const char *format, ...); void closelog(void); openlog() opens a connection to the system logger for a program. The string pointed to by ident is prepended to every message, and is typically set to the program name.
程序名称使用系统日志loggingfunction设置在程序代码中。