read system log?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Hello,
> 
>  Is there a way that an application can subscribe to the
> syslog (man 3 syslog) messages? Meaning... can my app
> get the messages in the same way as the /var/log/messages file?
> 
>  I am not referring to the kernel message reader/cleaner
> "syslog" (man 2 syslog)
> 
>  Thanks for any help. Apologize, if this is NOT the
> right forum to talk about this. Thanks!


I'm a little confused abput the way yu explain what you want to do.

If you want to process all (or some) messages, one easy way is to
mkfifo /var/log/programslog

Configure syslogd to write to the FIFO - see the contents of 
/etc/syslog.conf
Restart syslogd;
  service syslog restart

then open and read the FIFO with your program.

You might add a script to /etc/init.d and chkconfig it so as to make 
your program start on boot like so many others do. The startup script 
might evem make the FIFO - if so then it must run before syslog's does; 
otherwise syslog with create a file.




-- 
Cheers
John Summerfield

Microsoft's most solid OS: http://www.geocities.com/rcwoolley/

Note: mail delivered to me is deemed to be intended for me, for my 
disposition.

==============================
If you don't like being told you're wrong,
	be right!







[Index of Archives]     [Kernel Newbies]     [Red Hat General]     [Fedora]     [Red Hat Install]     [Linux Kernel Development]     [Yosemite News]

  Powered by Linux