我有交流程序,代码是
setlogmask (LOG_UPTO (LOG_NOTICE));
openlog ("thelog", LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL1);
syslog (LOG_NOTICE, "thelog : started by User %d", getuid ());
syslog (LOG_INFO, "thelog: an info is logging");
closelog();
代码工作正常但问题是日志被记录到文件 /var/log/messages ,我有 /etc/rsyslog.conf 没有和 syslog.conf
我希望将日志记录到新文件 /var/log/thelog.log 文件中
如何解决这个问题。