I"m in a CentosOS linux environment and I'm using syslog-ng to configure my logging for my php app.
on the php side I generate logs using the code below:
openlog(‘Program1', LOG_NDELAY, LOG_LOCAL1);
syslog(LOG_INFO, "My log message");
closelog();
Before I edited my syslog-ng.conf file all of the logs generated from the php code were logged into /var/log/messages.
I want to save my log to /var/log/program1.log so I added the following line to syslog-ng.conf:
local1.info /var/log/program1.log
But when I restarted the syslog-ng service I"m getting the following error:
Stopping syslog-ng: [FAILED]
Plugin module not found in 'module-path'; module-path='/lib64/syslog-ng', module='afsql'
Error parsing main, syntax error, unexpected LL_IDENTIFIER, expecting $end in /etc/syslog-ng/syslog-ng.conf at line X, column Y:
local1.info /var/log/programname.log
^^^^^^^^^^^
Any help would be much appreciated :)
In my syslog-ng.conf file I removed the following line:
local1.info /var/log/program1.log
and replaced it with this:
destination d_log1 {file("/var/log/program1.log"); };
log { source(s_sys); filter(f_local1); destination(d_log1); };
filter f_local1 { facility(local1); };
NOTE- I have also defined the source s_sys in my syslog-ng.conf file:
source s_sys {
file ("/proc/kmsg" program_override("kernel: "));
unix-dgram ("/dev/log");
internal();
udp(ip(0.0.0.0) port(514));
};