Re: Syslog and pg_options (for RPMs) - Mailing list pgsql-hackers

From ncm@zembu.com (Nathan Myers)
Subject Re: Syslog and pg_options (for RPMs)
Date
Msg-id 20010208141028.X624@store.zembu.com
Whole thread Raw
In response to Re: Syslog and pg_options (for RPMs)  (Lamar Owen <lamar.owen@wgcr.org>)
Responses Re: Syslog and pg_options (for RPMs)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Thu, Feb 08, 2001 at 04:00:12PM -0500, Lamar Owen wrote:
> "Dominic J. Eidson" wrote:
> > On Thu, 8 Feb 2001, Lamar Owen wrote:
> > > A syslogger of stderr would make a nice place to pipe the output :-).
> > > 'postmaster .... 2>&1 | output-to-syslog-program -f facility.desired' or
> 
> > 2>&1 | logger -p facility.level
> [snip]
> >      Logger provides a shell command interface to the syslog(3) system log
> >      module.
> 
> Good. POSIX required, and part of the base system (basically, guaranteed
> to be there on any Linux box).  Thanks for the pointer.

Not so fast... logger just writes its arguments to syslog.  I don't
see any indication that it (portably) reads its standard input.
It's meant for use in shellscripts.  You could write:
... 2>&1 | while read i; do logger -p local1.warning -t 'PG ' -- "$i"; done

but syslog is pretty high-overhead already without starting up logger
on every message.  Maybe stderr messages are infrequent enough that
it doesn't matter.

Nathan Myers
ncm@zembu.com


pgsql-hackers by date:

Previous
From: ncm@zembu.com (Nathan Myers)
Date:
Subject: Re: Syslog and pg_options (for RPMs)
Next
From: Tom Lane
Date:
Subject: Plan for straightening out the include-file mess