error handling in logging hooks - Mailing list pgsql-hackers

From Peter Eisentraut
Subject error handling in logging hooks
Date
Msg-id 1344612112.13818.6.camel@vanquo.pezone.net
Whole thread Raw
Responses Re: error handling in logging hooks
List pgsql-hackers
What is the intended way to handle errors in the new logging hook?  For
example, errors in establishing a connection to wherever a hook wants to
send things.

The reference implementation pg_logforward just uses fprintf(stderr) to
communicate its own errors, which doesn't seem ideal.

Calling elog(ERROR) in the logging hook causes death by recursion.  It
seems that some of the recursion protection infrastructure of elog.c
isn't exposed to the public, so it's not obvious how to use it.

Should logging hooks handle this themselves (could be complicated,
multiple hooks etc.), or should we try to build this into elog.c where
the hooks are called?





pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: bug of pg_trgm?
Next
From: Greg Stark
Date:
Subject: Re: WIP patch for consolidating misplaced-aggregate checks