How to log into a program?

Joseph S D Yao jsdy at cospo.osis.gov
Fri Jul 2 18:36:03 UTC 1999


> has anyone tried to redirect a logging channel into a program (other than
> syslog)? I would like to pipe the logging into a PERLscript for further
> processing but have not found any information about such a possibility in
> the "doc"-part of the 8.2.1 distribution. I would prefer to get the data
> from BIND directly rather than to have to process a logfile or the syslog.
> Can someone please point me into the right direction (or tell me that it's
> impossible without editing the source which I am not able to do ;-) )

Some versions of 'syslogd' allow one to redirect output to a named pipe
(aka FIFO).  The program that creates and reads this FIFO would have to
start before any logging could be done, of course.  I'm not sure how
this would differ from just having 'named' write to the FIFO.

You would, of course, have to write a simple "wrapper" program that
creates the FIFO and either execs the program with the FIFO as stdin,
or forks and execs the program, and actively reads from the FIFO and
feeds the program.

Or you could copy the PERL script and modify it.  Works even if you
can't edit the original.

--
Joe Yao				jsdy at cospo.osis.gov - Joseph S. D. Yao
COSPO/OSIS Computer Support					EMT-B
-----------------------------------------------------------------------
This message is not an official statement of COSPO policies.


More information about the bind-users mailing list