On Tue, 21 May 2002, Daniel Stone wrote:

> On Tue, May 21, 2002 at 06:20:29PM +0800, henry wrote:
> > Dear List:
> >                 I try to dump messages from my program to some file of /var/log
> > by inserting macro into my program as follows :
> >
> > #include<syslog.h>
> >
> > #define debug openlog("my_program",LOG_PID,LOG_USER); /
> >                         syslog(LOG_INFO,"I send a message to log");
> >
> > But nothing happen ,Could someone shed some light on it ,Thanks.
>
> I suggest removing the #define debug from the start of the openlog line,
> and getting rid of the forward slash as well.

It might not be relevant, but you also need to have a valid
/etc/syslog.conf entry for this log level. Then you need to restart
syslogd (killall -HUP syslogd).

Note that I once had a painful experience where it took a friend and I a
while to realise that if the log file doesn't exist, syslog doesn't create
it... You need to touch them first.

Mikal

-- 

Michael Still ([EMAIL PROTECTED])     UMT+10hrs

-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to