syslog facilites and postgres ? - Mailing list pgsql-general

From Day, David
Subject syslog facilites and postgres ?
Date
Msg-id 401084E5E73F4241A44F3C9E6FD794280108D22E70@exch-01
Whole thread Raw
Responses Re: syslog facilites and postgres ?  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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

pgsql-general by date:

Previous
From: Purdon
Date:
Subject: Re: Is pgFoundry Down? (2/18/2014)
Next
From: Tom Lane
Date:
Subject: Re: syslog facilites and postgres ?