In short, I print into some /var/log/apache2/myapp.log file from a fcgi application under apache. You can see the configuration changes which I performed after the "====================================" line.
As a result:
in /etc/cron.daily/sysklogd:
Code:
/etc/init.d/sysklogd reload-or-restart > /dev/null
calls:
in /etc/init.d/sysklogd:
Code:
sudo start-stop-daemon --stop --quiet --signal 1 --pidfile /var/run/syslogd.pid --name syslogd
and myapp.fcgi stops writing to myapp.log and it stays like that.
I changed:
in /etc/cron.daily/sysklogd:
Code:
/etc/init.d/sysklogd restart > /dev/null
and now:
Code:
sudo logrotate -f /etc/logrotate.conf
restarts all apache2 processes excepting one and kills myapp.fcgi.
It appears that the combination of apache2, fcgi and syslog makes a perfect mess of my logging. Of course, all system and apache2 native logging works flawlessly. Anybody with some experience in linux, please give me any advice. Do I have a chance to solve this?
===================================================================
Configuration:
I am using Ubuntu 8.04 lts server, Apache web server.
My (fast cgi) application uses:
Code:
#include <syslog.h>
syslog(LOG_LOCAL6|LOG_INFO, "new n= %d;\n", count);
to log some activity messages.
At the end of /etc/syslog.conf I added:
Code:
local6.=info -/var/log/apache2/myapp.log
In /etc/syslog.conf I added to each selector which contained "myapp.log":
Code:
;local6.!=info
like this:
Code:
*.*;auth,authpriv.none;local6.!=info -/var/log/syslog
and:
Code:
*.=info;*.=notice;*.=warn;\
auth,authpriv.none;\
cron,daemon.none;\
mail,news.none;local6.!=info -/var/log/messages