我有一個C程序代碼是rsyslogd問題,記錄與openlog(),但原木去到/ var/log/messages中
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文件
如何解決這個問題。
這裏LOCAL1手段?openlog(「thelog」,>>>>>> openlog(「local1」, – Kajal
這些是系統日誌配置文件'/etc/rsyslog.conf'的實際行,打開文件,讀取它,你會看到什麼我的意思是, – fvu
看起來kill -HUP不再有效,'man rsyslogd' 報告自v5以來,需要「真正的重啓」(例如/etc/rc.d/rsyslogd restart) – nephewtom