syslog stops writing in log
syslog stops writing immediately after log rotation, after I start the system (but not after reboot), and at some other times, into my fast cgi application's log. It starts working after /etc/init.d/sysklogd restart. Please give me any hint.
Configuration: I am using Ubuntu 8.04 lts server, Apache web server. My (fast cgi) application uses: Code:
#include <syslog.h> At the end of /etc/syslog.conf I added: Code:
local6.=info -/var/log/apache2/myapp.log Code:
;local6.!=info Code:
*.*;auth,authpriv.none;local6.!=info -/var/log/syslog Code:
*.=info;*.=notice;*.=warn;\ |
It seems that syslog ceases to function when syslogd is restarted automatically. This happens when I start or reboot the computer and when logs are rotated. After I:
Code:
/etc/init.d/sysklogd restart fflush(NULL); and closelog(); do not seem to make any difference. I was amazed today to discover that: Code:
wget localhost/myapp.fcgi?some%20data And this is also a BUMP. Doru |
I modified:
/etc/init.d/sysklogd reload-or-restart > /dev/null into: /etc/init.d/sysklogd restart > /dev/null in: /etc/cron.{weekly,daily}/sysklogd and now I got it going, I believe. However, I don't like this solution, because I don't know what is going on here. Other people have got the same problem: http://www.linuxquestions.org/questi...8-04-a-703386/ Doru |
The solution in my last post seems to be working. It works after the daily rotation. Thank you, Doru!
Doru |
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 in the first post.
As a result: in /etc/cron.daily/sysklogd: Code:
/etc/init.d/sysklogd reload-or-restart > /dev/null in /etc/init.d/sysklogd: Code:
sudo start-stop-daemon --stop --quiet --signal 1 --pidfile /var/run/syslogd.pid --name syslogd I changed: in /etc/cron.daily/sysklogd: Code:
/etc/init.d/sysklogd restart > /dev/null Code:
sudo logrotate -f /etc/logrotate.conf 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? |
Continued here: http://mailman.fastcgi.com/pipermail...er/000744.html
|
I would suggest to use the system logging facility in your myapp.fcgi and combine the two sources in the syslog facility you use.
|
Quote:
Am I not using the system logging facility already, since I call syslog? I don't understand what two sources in the syslog facility should I combine? I call syslog from myapp.fcgi, in C++. |
I’m quite confused what I had in mind too. What is your definition for the logrotation of the log files in /etc/logrotate.d.
|
Quote:
Code:
/etc/logrotate.d$ cat apache2 Quote:
|
All times are GMT -5. The time now is 01:10 PM. |