LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
LinkBack Search this Thread
Old 09-13-2010, 02:14 AM   #1
doru
Member
 
Registered: Sep 2008
Distribution: Ubuntu 8.04 LTS Server
Posts: 80

Rep: Reputation: 16
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>
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

Last edited by doru; 09-13-2010 at 02:22 AM.
 
Old 09-16-2010, 03:08 AM   #2
doru
Member
 
Registered: Sep 2008
Distribution: Ubuntu 8.04 LTS Server
Posts: 80

Original Poster
Rep: Reputation: 16
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
it all goes well. This is true for my fcgi application only, other system pre-configured logs work fine.

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
issued locally as root is logged well after I started the system, but access requests from other locations were not logged unless I did /etc/init.d/sysklogd restart.

And this is also a BUMP.

Doru
 
Old 09-17-2010, 03:20 AM   #3
doru
Member
 
Registered: Sep 2008
Distribution: Ubuntu 8.04 LTS Server
Posts: 80

Original Poster
Rep: Reputation: 16
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
 
Old 09-19-2010, 11:31 PM   #4
doru
Member
 
Registered: Sep 2008
Distribution: Ubuntu 8.04 LTS Server
Posts: 80

Original Poster
Rep: Reputation: 16
The solution in my last post seems to be working. It works after the daily rotation. Thank you, Doru!

Doru
 
  


Reply

Tags
sysklogd, syslog


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
syslog-ng stops logging eentonig Linux - Server 2 04-23-2010 09:51 AM
How to change Debian log rotation of syslog and daemon.log onmountain Linux - Newbie 2 07-31-2008 02:27 AM
I need help getting syslog to log remotely, this is just the regular syslog. abefroman Linux - Software 2 06-05-2008 11:36 AM
stop popa3d from writing to syslog? fmillion Linux - Server 1 02-24-2008 01:28 PM
syslog client to log to syslog-ng and itself noir911 Linux - Server 1 02-08-2008 09:51 AM


All times are GMT -5. The time now is 09:59 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration