From 19dbc3463161a142537ba5c569c8e6a073a318de Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 6 Mar 2012 15:35:41 -0500 Subject: Add a hook for processing messages due to be sent to the server log. Use-cases for this include custom log filtering rules and custom log message transmission mechanisms (for instance, lossy log message collection, which has been discussed several times recently). As is our common practice for hooks, there's no regression test nor user-facing documentation for this, though the author did exhibit a sample module using the hook. Martin Pihlak, reviewed by Marti Raudsepp --- src/include/utils/elog.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/include/utils') diff --git a/src/include/utils/elog.h b/src/include/utils/elog.h index fbc08df7dec..7b5bcfae6fd 100644 --- a/src/include/utils/elog.h +++ b/src/include/utils/elog.h @@ -334,6 +334,10 @@ extern void FlushErrorState(void); extern void ReThrowError(ErrorData *edata); extern void pg_re_throw(void) __attribute__((noreturn)); +/* Hook for intercepting messages before they are sent to the server log */ +typedef void (*emit_log_hook_type) (ErrorData *edata); +extern PGDLLIMPORT emit_log_hook_type emit_log_hook; + /* GUC-configurable parameters */ -- cgit v1.2.3