syslog facilites and postgres ?

From: "Day, David" <dday(at)redcom(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: syslog facilites and postgres ?
Date: 2014-02-18 20:38:49
Message-ID: 401084E5E73F4241A44F3C9E6FD794280108D22E70@exch-01
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Should I be able to run two syslog facilities simultaneously ( postgres local0, and a trigger function to local3 ) successfully ?

I have postgresql 9.3.1exit running on freebsd and sending errors to "syslog_facility= local0".
That works fine.

I have created an insert trigger on one of my datatables using plperlu that opens syslog to facility local3 which directs
portions of that newly inserted record to local3. ( see below). This works with the the following issue.

I find occasional notifications in my local3 log file that should I believe be in the local0 log file. E.g. I will see some of
my RAISE LOG output in the local3 output log file rather than in the local0 output log file. I suspect this is happening
during the window in which local3 is open and closed in the trigger function. I note that the errant notification I find in local3 is not also found
in local0.

Any suggestions on this concept ?

Thanks

Dave Day

CREATE OR REPLACE FUNCTION log.connection_history_post_insert()
RETURNS trigger AS
$BODY$
use Sys::Syslog;
openlog('smdr', 'ndelay,pid', 'local3');
my $tmp = $_TD->{new} {orig_addr} .'->' . $_TD->{new} {term_addr} . '~' . $_TD->{new} {answer_datetime}
syslog ("info", "data %s ", $tmp);
closelog();
return;
$BODY$
LANGUAGE plperlu VOLATILE

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2014-02-18 21:02:04 Re: syslog facilites and postgres ?
Previous Message Purdon 2014-02-18 17:41:39 Re: Is pgFoundry Down? (2/18/2014)